+
    WGj"                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHtHtHt ]P$                  ! ]4      t]P*                  ! R4      tR	 R
 lt]P0                   ! R R]4      4       tR# )    )annotationsN)Path)UnpackError)Link)add_ssh_scheme_to_git_uridisplay_path)
HiddenTextVersionControlvcs_supportz^[a-fA-F0-9]{40}$c                    V ^8  d   QhRRRR/# )   shastrreturnbool )formats   "/lib/python3.14/site-packages/unearth/vcs/git.py__annotate__r      s     ' ' ' '    c                >    \        \        P                  V 4      4      # N)r   
HASH_REGEXmatch)r   s   &r   looks_like_hashr      s    
  %&&r   c                      ] tR t^tRtRtR R ltR R ltR R ltR	 R
 lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltRtR# )Gitgitz.gitc                   V ^8  d   QhRR/# )r   r   ztuple[int, ...]r   )r   s   "r   r   Git.__annotate__   s     ; ; ;r   c                	J   V P                  R .RRR7      pVP                  P                  4       p\        P                  ! RV4      pV'       g   \        RV 24      h\        ;QJ d"    . R VP                  4        4       F  NK  	  5# ! R VP                  4        4       4      # )versionTF)stdout_only
log_outputz$git version (\d+)\.(\d+)(?:\.(\d+))?zFailed to get git version: c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   )int).0parts   & r   	<genexpr>&Git.get_git_version.<locals>.<genexpr>    s     :>4SYY>s   )run_commandstdoutstriprer   r   tuplegroups)selfresultoutputr   s   &   r   get_git_versionGit.get_git_version   s    !!9+4E!R$$&@&I ;F8DEEu:5<<>:u:u:5<<>:::r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   locationr   urlr	   rev
str | Noneargslist[str | HiddenText]r   Noner   )r   s   "r   r   r    "   s<     &* &*&* &* 	&*
 %&* 
&*r   c                	   V'       d   R V R2MRp\         P                  RW%\        V4      4       RpV P                  ^ 8:  d   RpRR/pMV P                  ^8X  d   RpMRpV P	                  4       R8  d&   V P                  RR.VOVN\        V4      NVR	7       M#V P                  R.VOVN\        V4      NVR	7       VeS   V P                  W4      '       d*   V P                  R
RW#.VR7       V P                  VR4      pM#V P                  W4      pMV P                  V4      p\         P                  RW(4       V P                  RRRV.VR7       V P                  V4       R# )z (revision: ) zCloning %s%s to %sNGIT_TERMINAL_PROMPT0clonez--filter=blob:none)	extra_envfetch-qcwd
FETCH_HEADzResolved %s to commit %sreset--hard)--quietr   )z	--verbosez
--progress)r      )loggerinfor   	verbosityr4   r+   r   _should_fetch_resolve_revisionget_revision_update_submodules)	r1   r7   r8   r9   r;   rev_displayenvflagsrevisions	   &&&&&    r   	fetch_newGit.fetch_new"   sm    03SE+(#L<RS>>Q%1E(#.C^^q E/E!W, .KKKS]K  
 gBBsBCMBcR?!!(00  '4!: I11(LI11(@((2H.>'8T8<(K)r   c                    V ^8  d   QhRRRR/# )r   r7   r   r   r=   r   )r   s   "r   r   r    J   s     
 
4 
D 
r   c                	~    VP                  R 4      P                  4       '       g   R# V P                  . ROVR7       R# )z.gitmodulesNrG   )	submoduleupdatez--initrF   z--recursive)joinpathexistsr+   r1   r7   s   &&r   rT   Git._update_submodulesJ   s7      /6688B 	 	
r   c               $    V ^8  d   QhRRRRRR/# )r   destr   r9   r   r   r   r   )r   s   "r   r   r    Q   s!      $ S T r   c                    VP                  R4      '       d   R# \        V4      '       g   R# V P                  W4      '       d   R# R# )z
Return true if rev is a ref or is a commit that we don't have locally.

Branches and tags are not considered in this method because they are
assumed to be always available locally (which is a normal outcome of
``git clone`` and ``git fetch --tags``).
zrefs/TF)
startswithr   
has_commit)r1   rd   r9   s   &&&r   rQ   Git._should_fetchQ   s9     >>'""s##??4%%r   c               $    V ^8  d   QhRRRRRR/# )r   r7   r   r9   r   r   r   r   )r   s   "r   r   r    g   s!      4 c d r   c                `     V P                  RRRRV 2.VR7       R#   \         d     R# i ; i)zE
Check if rev is a commit that is available in the local repository.
	rev-parserF   --verifyzsha^rG   TF)r+   r   r1   r7   r9   s   &&&r   rg   Git.has_commitg   sH    	dJ$se=     		s    --c               (    V ^8  d   QhRRRRRRRR/# )	r   r7   r   r9   r:   r;   r<   r   r=   r   )r   s   "r   r   r    u   s2     L LL#-L5KL	Lr   c                	   V P                  . R
OVR7       Ved   V P                  W4      '       d;   V P                  V4      pV P                  R RWB.VR7       V P                  VR4      pM%V P                  W4      pM V P                  VR4      p\
        P                  R\        V4      V4       V P                  RR	RV.VR7       R#   \         d    T P                  TR4      p LXi ; i)rE   rF   rG   NrI   zorigin/HEADHEADzUpdating %s to commit %srJ   rK   )rE   rF   z--tags)r+   rQ   get_remote_urlrR   r   rN   rO   r   )r1   r7   r9   r;   r8   resolveds   &&&&  r   r^   
Git.updateu   s     	2A?!!(00))(3  '4!: I11(LI11(@D11(MJ 	.X0FQ'8T8<(K  D11(FCDs   >C	 	C)(C)c                    V ^8  d   QhRRRR/# r   r7   r   r   r   r   )r   s   "r   r   r       s     8 8t 8 8r   c                	~   V P                  . ROR	VRRR7      pVP                  P                  4       p V^ ,          pT F  pTP                  R4      '       g   K  Tp M	  TP                  R4      ^,          pT P                  TP                  4       4      #   \         d    \	        R\        T4       24      Rhi ; i)
configTF)extra_ok_returncodesrH   r#   r$   zRemote not found for Nzremote.origin.url  )rx   z--get-regexpzremote\..*\.url)   )
r+   r,   
splitlines
IndexErrorr   r   rf   split_git_remote_to_pip_urlr-   )r1   r7   r2   remotesfound_remoteremoter8   s   &&     r   rr   Git.get_remote_url   s    !!:!% " 
 --**,	"1:L F  !566%    %a(**399;77  	'X(>'?@	s   	B $B<c                    V ^8  d   QhRRRR/# )r   r8   r   r   r   )r   s   "r   r   r       s     2 2# 2# 2r   c                	    R V9   d   V# \         P                  P                  V4      '       d7   \        \         P                  P	                  V4      4      P                  4       # \        V4      # )z://)ospathr`   r   abspathas_urir   )r1   r8   s   &&r   r   Git._git_remote_to_pip_url   sM    C<J77>>#,-4466,S11r   c               $    V ^8  d   QhRRRRRR/# )r   r7   r   r9   r:   r   r   r   )r   s   "r   r   r       s!      $ Z C r   c                	   Vf   R.pMVRV 2.p\        4       pV F:  p V P                  RRRV R2.VRRR	7      pTP                  P	                  4       u # 	  \
        P                  R
V4       Vh  \         d   pTp R p?Ki  R p?ii ; i)Nrq   zorigin/rk   rL   rl   z	^{commit}TF)rH   r#   r$   zUnable to resolve: %s)RuntimeErrorr+   r   r,   r-   rN   error)r1   r7   r9   rev_alternatives
last_error	check_revr2   es   &&&     r   rR   Git._resolve_revision   s    ; &x #wse_5!^
)I	)) )ZI;k9RS  $$	 *  ==&&(( * 	,c2  
s   A22B
=BB
c                    V ^8  d   QhRRRR/# rv   r   )r   s   "r   r   r       s     6 6T 6c 6r   c                	&    V P                  VR 4      # r   )rR   ra   s   &&r   rS   Git.get_revision   s    %%h55r   c               $    V ^8  d   QhRRRRRR/# )r   r7   r   r9   r:   r   r   r   )r   s   "r   r   r       s&     F FT F
 Ft Fr   c                	B    VR J;'       d    V P                  V4      V8H  # r   )rS   rm   s   &&&r   is_commit_hash_equalGit.is_commit_hash_equal   s$    $EE4#4#4X#>##EEr   c               $    V ^8  d   QhRRRRRR/# )r   r7   r   linkr   r   r   r   )r   s   "r   r   r       s!     8 8d 8$ 84 8r   c                	X    V P                  V4      w  r4pVf   R# V P                  W4      # )NF)get_url_and_rev_optionsr   )r1   r7   r   _r9   s   &&&  r   is_immutable_revisionGit.is_immutable_revision   s/    006	;((77r   r   N)__name__
__module____qualname____firstlineno__namedir_namer4   rY   rT   rQ   rg   r^   rr   r   rR   rS   r   r   __static_attributes__r   r   r   r   r      sP    DH;&*P
,L(8.2*6F8 8r   r   )
__future__r   loggingr   r.   pathlibr   unearth.errorsr   unearth.linkr   unearth.utilsr   r   unearth.vcs.baser	   r
   r   	getLoggerr   rN   compiler   r   registerr   r   r   r   <module>r      sk    "  	 	  &  A D D			8	$ZZ+,
' q8. q8 q8r   