
    .Ph                        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__     G/var/www/html/test/jupyter/venv/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   zBase 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	          |          | _        || _        |rt          |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 FA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    'E4=11 	&mmooG1':: 	J&),, J'+F||'<'<'<k#f++>V>V>V>VWJ,s6{{:FF"I. J J J#CKK00A+5fc+B+BIVaZZFFFJ  Q00	 F F F F FFF7!7>3#F++#F++#J(:](JPb#J(:](JPb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tCy%S/367Q c3i/0Q eS$&'	Q
 eS$&'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   zThrown 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,d3isS&@ A ,%PSU^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*.*.: :tCy%S/367: c3i/0: eS$&'	:
 eS$&': 
: : : : : : : : : :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   zThrown 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          +/*.* *tCy%S/367* c3i/0* eS$&'	*
 eS$&'* 
* * * * * * * * * *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     <@IIIt||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 1y 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*   