HLꚌbdZddlmZddlTddlmZddlmZddlmZm Z m Z m Z m Z ddl mZe rddlmZGd d eZGd d eZGd deZGddeeZGddeZGddeZGddeZGddeZGddeZGddeZGddeZGdd eZGd!d"eZGd#d$eZ d%S)&zE Module containing all exceptions thrown throughout the git package, )BadName)* safe_decode)remove_password_if_present)ListSequenceTupleUnion TYPE_CHECKING)PathLike)RepoceZdZdZdS)GitErrorz%Base class for all package exceptionsN__name__ __module__ __qualname____doc__/srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/exc.pyrrs////rrceZdZdZdS)InvalidGitRepositoryErrorzAThrown if the given repository appears to have an invalid format.NrrrrrrsKKKKrrceZdZdZdS)WorkTreeRepositoryUnsupportedz9Thrown to indicate we can't handle work tree repositoriesNrrrrrr sCCCCrrceZdZdZdS)NoSuchPathErrorz3Thrown if a path could not be access by the system.Nrrrrrr$s====rrceZdZdZdS)UnsafeProtocolErrorzGThrown if unsafe protocols are passed without being explicitly allowed.Nrrrrr r (sQQQQrr ceZdZdZdS)UnsafeOptionErrorzEThrown if unsafe options are passed without being explicitly allowed.Nrrrrr"r",sOOOOrr"c eZdZdZdZ d deeeeedfefdeee de fdee edfdee edfd df d Z d efd Z dS) CommandErrorzBase class for exceptions thrown at every stage of `Popen()` execution. :param command: A non-empty list of argv comprising the command-line. zCmd('%s') failed%sNcommand.statusstderrstdoutreturnct|ttfs|}t ||_||_|rt|tr5t|j dtt|d}nc dt|z}nO#ttf$r;tt|}t|trd|zn|}YnwxYwt|jd|_dd|jD|_|rd|zpd |_t|}t|}|rd |zpd |_|rd |zpd |_dS) Nz('z')z exit code(%s)z'%s'r c34K|]}t|VdSNr).0is r z(CommandError.__init__..Rs( F FAQ F F F F F Frz due to: %s!z stdout: '%s'z stderr: '%s') isinstancetuplelistsplitrr%r& Exceptiontyperrstrint ValueError TypeError_cmdjoin_cmdline_causer(r')selfr%r&r'r(s stdout_decode stderr_decodes r__init__zCommandError.__init__<s'E4=11 &mmooG1'::   J&),, J'+F||'<'<'V>V>V>VWJ,s6{{:FF"I.JJJ#CKK00A+5fc+B+BIVaZZFFFJ  Q00  F F F F FFF 7!7>3 #F++ #F++ #J(:](JPb #J(:](JPb sB,,A C87C8cX|jdz|j|j|j|j|jfzS)Nz cmdline: %s%s%s)_msgr=r@r?r(r'rAs r__str__zCommandError.__str__Ys5 11 I K M K K 6   rNNN)rrrrrGr rr9r r:r7bytesrErIrrrr$r$0s D 48*.*. QQtCy%S/367Qc3i/0QeS$&' Q eS$&' Q  QQQQ:       rr$cjeZdZdZdeeeeeefdeeefddffd Z xZ S)GitCommandNotFoundzThrown if we cannot find the `git` executable in the PATH or at the path given by the GIT_PYTHON_GIT_EXECUTABLE environment variabler%causer)Nchtt|||d|_dS)NzCmd('%s') not found%s)superrMrErG)rAr%rN __class__s rrEzGitCommandNotFound.__init__gs/  $''00%@@@+ r) rrrrr rr9r r7rE __classcell__rQs@rrMrMcs}::,d3isS&@ A,%PSU^P^J_,dh,,,,,,,,,,rrMc eZdZdZ d deeeeedfefdeeede fdee edfdee edfddf fd Z xZ S) GitCommandErrorzGThrown if execution of the git command fails with non-zero status code.Nr%.r&r'r(r)c^tt|||||dSr-)rPrUrErAr%r&r'r(rQs rrEzGitCommandError.__init__os/ ot$$--gvvvNNNNNrrJ rrrrr rr9r r:r7rKrErRrSs@rrUrUlsQQ 48*.*. OOtCy%S/367Oc3i/0OeS$&' O eS$&' O  OOOOOOOOOOrrUc ^eZdZdZdedeedeedeeddf dZdefd Z dS) CheckoutErroraThrown if a file could not be checked out from the index as it contained changes. The .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 .failed_reasons attribute contains a string informing about the actual cause of the issue. The .valid_files attribute contains a list of relative paths to files that were checked out successfully and hence match the version stored in the indexmessage failed_files valid_filesfailed_reasonsr)Ncft||||_||_||_dSr-)r7rEr\r^r])rAr[r\r]r^s rrEzCheckoutError.__init__s8 4)))(,&rcLt|d|jzzS)Nz:%s)r7rIr\rHs rrIzCheckoutError.__str__s#  &&1B)BBBr) rrrrr9r r rrErIrrrrZrZys    ' 'x( 'h' ' S '  ' ' ' 'CCCCCCCrrZceZdZdZdS) CacheErrorzNBase for all errors related to the git index, which is called cache internallyNrrrrrbrbsXXXXrrbceZdZdZdS)UnmergedEntriesErrorzZThrown if an operation cannot proceed as there are still unmerged entries in the cacheNrrrrrdrdsrrdc eZdZdZ d deeeeedfefdeeede fdee edfdee edfddf fd Z xZ S) HookExecutionErrorzThrown if a hook exits with a non-zero exit code. It provides access to the exit code and the string returned via standard outputNr%.r&r'r(r)cltt|||||d|_dS)NzHook('%s') failed%s)rPrfrErGrWs rrEzHookExecutionError.__init__s5  $''00&&&QQQ) r)NNrXrSs@rrfrfs+/*. * *tCy%S/367 *c3i/0 *eS$&' * eS$&' *  * * * * * * * * * *rrfc2eZdZdZdddeddfdZdefdZdS) RepositoryDirtyErrorzjThrown whenever an operation on a repository fails as it has uncommitted changes that would be overwrittenreporr[r)Nc"||_||_dSr-rjr[)rArjr[s rrEzRepositoryDirtyError.__init__s  rc&d|jd|jS)Nz!Operation cannot be performed on z: rlrHs rrIzRepositoryDirtyError.__str__s<@IIIt||TTr)rrrrr9rErIrrrririsettVcdUUUUUUUrriN)!r gitdb.excr git.compatrgit.utilrtypingrr r r r git.typesr git.repo.baserr7rrrOSErrorrr r"r$rMrUrZrbrdrfrirrrrusD LK""""""//////?>>>>>>>>>>>>>#"""""" 00000y000LLLLLLLLDDDDD$=DDD>>>>>h>>>RRRRR(RRRPPPPPPPP0 0 0 0 0 80 0 0 f,,,,,,,, O O O O Ol O O OCCCCCHCCC>YYYYYYYY : * * * * * * * * UUUUU8UUUUUr