yL idZgdZddlmZmZmZmZmZmZm Z m Z ddl m Z ddl mZddlmZmZmZmZmZddlmZerddlmZGd d eZGd d eZGd deZGddeeZGddeZGddeZ GddeZ!Gdde!Z"Gdde!Z#GddeZ$GddeZ%Gdd e%Z&Gd!d"e!Z'Gd#d$eZ(y%)&z-Exceptions thrown throughout the git package.)AmbiguousObjectNameBadName BadObject BadObjectType InvalidDBRootODBError ParseErrorUnsupportedOperationGitErrorInvalidGitRepositoryErrorWorkTreeRepositoryUnsupportedNoSuchPathErrorUnsafeProtocolErrorUnsafeOptionError CommandErrorGitCommandNotFoundGitCommandError CheckoutError CacheErrorUnmergedEntriesErrorHookExecutionErrorRepositoryDirtyError)rrrrrrrr  safe_decode)remove_password_if_present)ListSequenceTuple TYPE_CHECKINGUnion)PathLike)RepoceZdZdZy)r z&Base class for all package exceptions.N__name__ __module__ __qualname____doc__M/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/git/exc.pyr r =s0r*r ceZdZdZy)r zAThrown if the given repository appears to have an invalid format.Nr$r)r*r+r r AsKr*r ceZdZdZy)r z:Thrown to indicate we can't handle work tree repositories.Nr$r)r*r+r r EsDr*r ceZdZdZy)r z3Thrown if a path could not be access by the system.Nr$r)r*r+r r Is=r*r ceZdZdZy)rzGThrown if unsafe protocols are passed without being explicitly allowed.Nr$r)r*r+rrMsQr*rceZdZdZy)rzEThrown if unsafe options are passed without being explicitly allowed.Nr$r)r*r+rrQsOr*rc eZdZdZdZ d deeeeedfefdeee de fdee edfdee edfd df d Z d efd Z y) rzBase class for exceptions thrown at every stage of :class:`~subprocess.Popen` execution. :param command: A non-empty list of argv comprising the command-line. zCmd('%s') failed%sNcommand.statusstderrstdoutreturnct|ttfs|j}t ||_||_|rMt|tr.t|jdtt|d}n dt|z}t|j d|_dj!d|j D|_|xrd|zxsd |_t|}t|}|xrd |zxsd |_|xrd |zxsd |_y#ttf$r.tt|}t|trd|zn|}YwxYw) Nz('z')z exit code(%s)z'%s'r c32K|]}t|ywNr).0is r+ z(CommandError.__init__..{s FAQ Fsz due to: %s!z stdout: '%s'z stderr: '%s') isinstancetuplelistsplitrr2r3 Exceptiontyper%rstrint ValueError TypeError_cmdjoin_cmdline_causer5r4)selfr2r3r4r5s stdout_decode stderr_decodes r+__init__zCommandError.__init__es0'E4=1mmoG1':  &),'+F|'<'VWJ,s6{:F   Q0  F FF 7!7>3 #F+ #F+ #J(:](JPb #J(:](JPb #I.J#CK0A+5fc+BVaZFJs?D:EEc|jdz|j|j|j|j|j fzS)Nz cmdline: %s%s%s)_msgrJrMrLr5r4rNs r+__str__zCommandError.__str__sA 11 II KK MM KK KK 6   r*NNN)r%r&r'r(rTr rrFrrGrDbytesrRrVr)r*r+rrUs D48*.*. QtCy%S/367Qc3i/0QeS$&' Q eS$&' Q  Q:  r*rcReZdZdZdeeeeeefdeeefddffd Z xZ S)rzThrown 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.r2causer6Nc4t|||d|_y)NzCmd('%s') not found%ssuperrRrT)rNr2rZ __class__s r+rRzGitCommandNotFound.__init__s %(+ r*) r%r&r'r(r rrFrrDrR __classcell__r^s@r+rrsIS,d3isS&@ A,%PSU^P^J_,dh,,r*rc eZdZdZ d deeeeedfefdeeede fdee edfdee edfddf fd Z xZ S) rzGThrown if execution of the git command fails with non-zero status code.Nr2.r3r4r5r6c*t|||||yr:)r]rRrNr2r3r4r5r^s r+rRzGitCommandError.__init__s &&&9r*rW r%r&r'r(r rrFrrGrDrXrRr_r`s@r+rrsQ 48*.*. :tCy%S/367:c3i/0:eS$&' : eS$&' :  ::r*rc JeZdZdZdedeedeedeeddf dZdefd Z y) raThrown 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_filesfailed_reasonsr6NcZtj||||_||_||_yr:)rDrRrgrirh)rNrfrgrhris r+rRzCheckoutError.__init__s, 4)(,&r*cLtj|d|jzzS)Nz:%s)rDrVrgrUs r+rVzCheckoutError.__str__s#  &1B1B)BBBr*) r%r&r'r(rFrr!rrRrVr)r*r+rrsX  ' 'x( 'h' ' S '  'CCr*rceZdZdZy)rzUBase for all errors related to the git index, which is called "cache" internally.Nr$r)r*r+rrsr*rceZdZdZy)rz[Thrown if an operation cannot proceed as there are still unmerged entries in the cache.Nr$r)r*r+rrsr*rc eZdZdZ d deeeeedfefdeeede fdee edfdee edfddf fd Z xZ S) rzThrown 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.r3r4r5r6c8t|||||d|_y)NzHook('%s') failed%sr\rcs r+rRzHookExecutionError.__init__s &&&9) r*)NNrdr`s@r+rrs+/*. *tCy%S/367*c3i/0*eS$&' * eS$&' *  **r*rc0eZdZdZdddeddfdZdefdZy) rzoThrown whenever an operation on a repository fails as it has uncommitted changes that would be overwritten.repor"rfr6Nc ||_||_yr:rqrf)rNrqrfs r+rRzRepositoryDirtyError.__init__s  r*c:d|jd|jS)Nz!Operation cannot be performed on z: rsrUs r+rVzRepositoryDirtyError.__str__s<@IIt||TTr*)r%r&r'r(rFrRrVr)r*r+rrs/"VcdUUr*rN))r(__all__ gitdb.excrrrrrrrr git.compatrgit.utilrtypingrrrrr git.typesr! git.repo.baser"rDr r r OSErrorr rrrrrrrrrrr)r*r+r}s 4 6   #/?>" 1y1LLE$=E>h>R(RPP4 84 n,, :l :CHC< : **" U8 Ur*