§
    ÎÑßjÏ  ã                   ó  — d Z g d¢ZddlmZmZmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZmZmZmZmZ ddlmZ erddlmZ  G d	„ d
e¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ dee¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z  G d„ de¦  «        Z! G d„ de!¦  «        Z" G d„ de!¦  «        Z# G d„ de¦  «        Z$ G d„ de¦  «        Z% G d„ d e%¦  «        Z& G d!„ d"e!¦  «        Z' G d#„ d$e¦  «        Z(d%S )&z-Exceptions thrown throughout the git package.)ÚAmbiguousObjectNameÚBadNameÚ	BadObjectÚBadObjectTypeÚInvalidDBRootÚODBErrorÚ
ParseErrorÚUnsupportedOperationÚGitErrorÚInvalidGitRepositoryErrorÚWorkTreeRepositoryUnsupportedÚNoSuchPathErrorÚUnsafeProtocolErrorÚUnsafeOptionErrorÚCommandErrorÚGitCommandNotFoundÚGitCommandErrorÚCheckoutErrorÚ
CacheErrorÚUnmergedEntriesErrorÚHookExecutionErrorÚRepositoryDirtyErroré    )r   r   r   r   r   r   r   r	   ©Úsafe_decode)Úremove_password_if_present)ÚListÚSequenceÚTupleÚTYPE_CHECKINGÚUnion)ÚPathLike)ÚRepoc                   ó   — e Zd ZdZdS )r
   z&Base class for all package exceptions.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú;/opt/saltstack/salt/lib/python3.11/site-packages/git/exc.pyr
   r
   =   s   € € € € € Ø0Ð0Ð0Ð0r*   r
   c                   ó   — e Zd ZdZdS )r   zAThrown if the given repository appears to have an invalid format.Nr$   r)   r*   r+   r   r   A   s   € € € € € ØKÐKÐKÐKr*   r   c                   ó   — e Zd ZdZdS )r   z:Thrown to indicate we can't handle work tree repositories.Nr$   r)   r*   r+   r   r   E   s   € € € € € ØDÐDÐDÐDr*   r   c                   ó   — e Zd ZdZdS )r   z3Thrown if a path could not be access by the system.Nr$   r)   r*   r+   r   r   I   s   € € € € € Ø=Ð=Ð=Ð=r*   r   c                   ó   — e Zd ZdZdS )r   zGThrown if unsafe protocols are passed without being explicitly allowed.Nr$   r)   r*   r+   r   r   M   s   € € € € € ØQÐQÐQÐQr*   r   c                   ó   — e Zd ZdZdS )r   zEThrown if unsafe options are passed without being explicitly allowed.Nr$   r)   r*   r+   r   r   Q   s   € € € € € ØOÐOÐOÐOr*   r   c                   ó®   — e Zd ZdZdZ	 	 	 	 ddeee         eedf         ef         deee	de
f         deeedf         deeedf         d	df
d
„Zd	efd„ZdS )r   z´Base class for exceptions thrown at every stage of :class:`~subprocess.Popen`
    execution.

    :param command:
        A non-empty list of argv comprising the command-line.
    zCmd('%s') failed%sNÚcommand.ÚstatusÚstderrÚstdoutÚreturnc                 ó  — t          |t          t          f¦  «        s|                     ¦   «         }t	          |¦  «        | _        || _        |r­t          |t          ¦  «        r5t          |¦  «        j	        ›dt          t          |¦  «        ¦  «        ›d�}nc	 dt          |¦  «        z  }nO# t          t          f$ r; t          t          |¦  «        ¦  «        }t          |t          ¦  «        rd|z  n|}Y nw xY wt          | j        d         ¦  «        | _        d                     d„ | j        D ¦   «         ¦  «        | _        |rd|z  pd	| _        t          |¦  «        }t          |¦  «        }|rd
|z  pd| _        |rd|z  pd| _        d S )Nz('z')zexit code(%s)z'%s'r   ú c              3   ó4   K  — | ]}t          |¦  «        V — Œd S ©Nr   )Ú.0Úis     r+   ú	<genexpr>z(CommandError.__init__.<locals>.<genexpr>{   s(   è è € Ð FÐ F°A¥¨Q¡¤Ð FÐ FÐ FÐ FÐ FÐ Fr*   z due to: %sú!z
  stdout: '%s'Ú z
  stderr: '%s')Ú
isinstanceÚtupleÚlistÚsplitr   r2   r3   Ú	ExceptionÚtyper%   r   ÚstrÚintÚ
ValueErrorÚ	TypeErrorÚ_cmdÚjoinÚ_cmdlineÚ_causer5   r4   )Úselfr2   r3   r4   r5   ÚsÚstdout_decodeÚstderr_decodes           r+   Ú__init__zCommandError.__init__e   s”  € õ ˜'¥E­4 =Ñ1Ô1ð 	&Ø—m’m‘o”oˆGÝ1°'Ñ:Ô:ˆŒØˆŒØð 	JÝ˜&¥)Ñ,Ô,ð JÝ'+¨F¡|¤|Ô'<Ð'<Ð'<½kÍ#ÈfÉ+Ì+Ñ>VÔ>VÐ>VÐ>VÐW��ðJØ,­s°6©{¬{Ñ:�F�FøÝ"¥IÐ.ð Jð Jð JÝ#¥C¨¡K¤KÑ0Ô0�AÝ+5°f½cÑ+BÔ+BÐI˜V a™Z˜ZÈ�F�F�FðJøøøõ   ¤¨Q¤Ñ0Ô0ˆŒ	ØŸšÐ FÐ F¸¼Ð FÑ FÔ FÑFÔFˆŒØÐ7 °Ñ!7Ð>¸3ˆŒÝ# FÑ+Ô+ˆÝ# FÑ+Ô+ˆØ#ÐJÐ(:¸]Ñ(JÐPÈbˆŒØ#ÐJÐ(:¸]Ñ(JÐPÈbˆŒˆˆs   ÂB, Â,A	C8Ã7C8c                 óX   — | j         dz   | j        | j        | j        | j        | j        fz  S )Nz
  cmdline: %s%s%s)Ú_msgrJ   rM   rL   r5   r4   ©rN   s    r+   Ú__str__zCommandError.__str__‚   s5   € Ø”	Ð1Ñ1ØŒIØŒKØŒMØŒKØŒKð6
ñ 
ð 	
r*   ©NNN)r%   r&   r'   r(   rT   r    r   rF   r   rG   rD   ÚbytesrR   rV   r)   r*   r+   r   r   U   sá   € € € € € ðð ð  €Dðð 48Ø*.Ø*.ðQð Qà�t˜C”y %¨¨S¨¤/°3Ð6Ô7ðQð �c˜3  iÐ/Ô0ðQð �e˜S $Ð&Ô'ð	Qð
 �e˜S $Ð&Ô'ðQð 
ðQð Qð Qð Qð:
˜ð 
ð 
ð 
ð 
ð 
ð 
r*   r   c                   ój   ‡ — e Zd ZdZdeee         ee         ef         deeef         ddfˆ fd„Z	ˆ xZ
S )r   zŸThrown if we cannot find the ``git`` executable in the :envvar:`PATH` or at the
    path given by the :envvar:`GIT_PYTHON_GIT_EXECUTABLE` environment variable.r2   Úcauser6   Nc                 óZ   •— t          ¦   «                              ||¦  «         d| _        d S )NzCmd('%s') not found%s©ÚsuperrR   rT   )rN   r2   rZ   Ú	__class__s      €r+   rR   zGitCommandNotFound.__init__�   s(   ø€ Ý‰Œ×Ò˜ %Ñ(Ô(Ð(Ø+ˆŒ	ˆ	ˆ	r*   )r%   r&   r'   r(   r    r   rF   r   rD   rR   Ú__classcell__©r^   s   @r+   r   r   Œ   s   ø€ € € € € ðSð Sð,  d¨3¤i°°s´¸SÐ&@Ô Að ,È%ÐPSÐU^ÐP^ÔJ_ð ,Ðdhð ,ð ,ð ,ð ,ð ,ð ,ð ,ð ,ð ,ð ,r*   r   c                   ó¦   ‡ — e Zd ZdZ	 	 	 d
deee         eedf         ef         deeede	f         dee
edf         dee
edf         ddf
ˆ fd	„Zˆ xZS )r   zGThrown if execution of the git command fails with non-zero status code.Nr2   .r3   r4   r5   r6   c                 óP   •— t          ¦   «                              ||||¦  «         d S r:   )r]   rR   ©rN   r2   r3   r4   r5   r^   s        €r+   rR   zGitCommandError.__init__˜   s)   ø€ õ 	‰Œ×Ò˜ &¨&°&Ñ9Ô9Ð9Ð9Ð9r*   rW   ©r%   r&   r'   r(   r    r   rF   r   rG   rD   rX   rR   r_   r`   s   @r+   r   r   •   sÁ   ø€ € € € € ØQÐQð
 48Ø*.Ø*.ð:ð :à�t˜C”y %¨¨S¨¤/°3Ð6Ô7ð:ð �c˜3  iÐ/Ô0ð:ð �e˜S $Ð&Ô'ð	:ð
 �e˜S $Ð&Ô'ð:ð 
ð:ð :ð :ð :ð :ð :ð :ð :ð :ð :r*   r   c            
       ó^   — e Zd ZdZdedee         dee         dee         ddf
d„Zdefd	„Z	dS )
r   a  Thrown if a file could not be checked out from the index as it contained
    changes.

    The :attr:`failed_files` attribute contains a list of relative paths that failed to
    be checked out as they contained changes that did not exist in the index.

    The :attr:`failed_reasons` attribute contains a string informing about the actual
    cause of the issue.

    The :attr:`valid_files` attribute contains a list of relative paths to files that
    were checked out successfully and hence match the version stored in the index.
    ÚmessageÚfailed_filesÚvalid_filesÚfailed_reasonsr6   Nc                 óf   — t                                | |¦  «         || _        || _        || _        d S r:   )rD   rR   rg   ri   rh   )rN   rf   rg   rh   ri   s        r+   rR   zCheckoutError.__init__°   s8   € õ 	×Ò˜4 Ñ)Ô)Ð)Ø(ˆÔØ,ˆÔØ&ˆÔÐÐr*   c                 óL   — t                                | ¦  «        d| j        z  z   S )Nz:%s)rD   rV   rg   rU   s    r+   rV   zCheckoutError.__str__¼   s#   € Ý× Ò  Ñ&Ô&¨°Ô1BÑ)BÑBÐBr*   )
r%   r&   r'   r(   rF   r   r!   r   rR   rV   r)   r*   r+   r   r   ¢   s’   € € € € € ðð ð
'àð
'ð ˜xÔ(ð
'ð ˜hÔ'ð	
'ð
 ˜Sœ	ð
'ð 
ð
'ð 
'ð 
'ð 
'ðC˜ð Cð Cð Cð Cð Cð Cr*   r   c                   ó   — e Zd ZdZdS )r   zUBase for all errors related to the git index, which is called "cache"
    internally.Nr$   r)   r*   r+   r   r   À   s   € € € € € ðð ð ð r*   r   c                   ó   — e Zd ZdZdS )r   z[Thrown if an operation cannot proceed as there are still unmerged
    entries in the cache.Nr$   r)   r*   r+   r   r   Å   s   € € € € € ðð ð ð r*   r   c                   ó¤   ‡ — e Zd ZdZ	 	 d
deee         eedf         ef         deeede	f         dee
edf         dee
edf         ddf
ˆ fd	„Zˆ xZS )r   zŽThrown if a hook exits with a non-zero exit code.

    This provides access to the exit code and the string returned via standard output.
    Nr2   .r3   r4   r5   r6   c                 ó^   •— t          ¦   «                              ||||¦  «         d| _        d S )NzHook('%s') failed%sr\   rc   s        €r+   rR   zHookExecutionError.__init__Ð   s.   ø€ õ 	‰Œ×Ò˜ &¨&°&Ñ9Ô9Ð9Ø)ˆŒ	ˆ	ˆ	r*   )NNrd   r`   s   @r+   r   r   Ê   sÂ   ø€ € € € € ðð ð +/Ø*.ð*ð *à�t˜C”y %¨¨S¨¤/°3Ð6Ô7ð*ð �c˜3  iÐ/Ô0ð*ð �e˜S $Ð&Ô'ð	*ð
 �e˜S $Ð&Ô'ð*ð 
ð*ð *ð *ð *ð *ð *ð *ð *ð *ð *r*   r   c                   ó2   — e Zd ZdZdddeddfd„Zdefd„ZdS )	r   zoThrown whenever an operation on a repository fails as it has uncommitted changes
    that would be overwritten.Úrepor"   rf   r6   Nc                 ó"   — || _         || _        d S r:   ©rq   rf   )rN   rq   rf   s      r+   rR   zRepositoryDirtyError.__init__ß   s   € ØˆŒ	ØˆŒˆˆr*   c                 ó&   — d| j         ›d| j        ›�S )Nz!Operation cannot be performed on z: rs   rU   s    r+   rV   zRepositoryDirtyError.__str__ã   s   € € Ø<@¼I¸I¸IÀtÄ|À|ÐTÐTr*   )r%   r&   r'   r(   rF   rR   rV   r)   r*   r+   r   r   Û   si   € € € € € ð"ð "ð˜Vð ¨cð °dð ð ð ð ðU˜ð Uð Uð Uð Uð Uð Ur*   r   N))r(   Ú__all__Ú	gitdb.excr   r   r   r   r   r   r   r	   Ú
git.compatr   Úgit.utilr   Útypingr   r   r   r   r    Ú	git.typesr!   Úgit.repo.baser"   rD   r
   r   r   ÚOSErrorr   r   r   r   r   r   r   r   r   r   r   r)   r*   r+   ú<module>r}      sŒ  ðð 4Ð 3ðð ð €ð6	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð #Ð "Ð "Ð "Ð "Ð "Ø /Ð /Ð /Ð /Ð /Ð /ð ?Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >à Ð Ð Ð Ð Ð àð #Ø"Ð"Ð"Ð"Ð"Ð"ð
1ð 1ð 1ð 1ð 1ˆyñ 1ô 1ð 1ðLð Lð Lð Lð L ñ Lô Lð LðEð Eð Eð Eð EÐ$=ñ Eô Eð Eð>ð >ð >ð >ð >�h ñ >ô >ð >ðRð Rð Rð Rð R˜(ñ Rô Rð RðPð Pð Pð Pð P˜ñ Pô Pð Pð4
ð 4
ð 4
ð 4
ð 4
�8ñ 4
ô 4
ð 4
ðn,ð ,ð ,ð ,ð ,˜ñ ,ô ,ð ,ð
:ð 
:ð 
:ð 
:ð 
:�lñ 
:ô 
:ð 
:ðCð Cð Cð Cð C�Hñ Cô Cð Cð<ð ð ð ð �ñ ô ð ð
ð ð ð ð ˜:ñ ô ð ð
*ð *ð *ð *ð *˜ñ *ô *ð *ð"	Uð 	Uð 	Uð 	Uð 	U˜8ñ 	Uô 	Uð 	Uð 	Uð 	Ur*   