diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-05-18 08:29:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-18 08:29:52 +0800 |
commit | b11bcfa3df4d0b792823930bffae126fd12673f7 (patch) | |
tree | 85dc837ef6cadec84d232f5e7110d2dfc44c3b1a /git/exc.py | |
parent | 33346b25c3a4fb5ea37202d88d6a6c66379099c5 (diff) | |
parent | c30bf3ba7548a0e996907b9a097ec322760eb43a (diff) | |
download | gitpython-b11bcfa3df4d0b792823930bffae126fd12673f7.tar.gz |
Merge pull request #1244 from Yobmod/main
Added types to Index submodule
Diffstat (limited to 'git/exc.py')
-rw-r--r-- | git/exc.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -11,7 +11,7 @@ from git.compat import safe_decode # typing ---------------------------------------------------- -from typing import List, Optional, Tuple, Union, TYPE_CHECKING +from typing import List, Sequence, Tuple, Union, TYPE_CHECKING from git.types import PathLike if TYPE_CHECKING: @@ -113,7 +113,7 @@ class CheckoutError(GitError): were checked out successfully and hence match the version stored in the index""" - def __init__(self, message: str, failed_files: List[PathLike], valid_files: List[PathLike], + def __init__(self, message: str, failed_files: Sequence[PathLike], valid_files: Sequence[PathLike], failed_reasons: List[str]) -> None: Exception.__init__(self, message) @@ -139,8 +139,11 @@ class HookExecutionError(CommandError): """Thrown if a hook exits with a non-zero exit code. It provides access to the exit code and the string returned via standard output""" - def __init__(self, command: Union[List[str], Tuple[str, ...], str], status: Optional[str], - stderr: Optional[str] = None, stdout: Optional[str] = None) -> None: + def __init__(self, command: Union[List[str], Tuple[str, ...], str], + status: Union[str, int, None, Exception], + stderr: Union[bytes, str, None] = None, + stdout: Union[bytes, str, None] = None) -> None: + super(HookExecutionError, self).__init__(command, status, stderr, stdout) self._msg = "Hook('%s') failed%s" |