diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-07-02 07:54:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-02 07:54:45 +0800 |
commit | 18c777bf815357663226fd6834c8b1bcfe9b7b62 (patch) | |
tree | 6e60335c9c631c38d0e88cf0ac11623985b8bd36 /git/index/base.py | |
parent | 8ad4f5923e7df65a4ad30a527ab10abc88f74f64 (diff) | |
parent | d4a9eab9ddc64a18b33ac04a4224f347ccdc78de (diff) | |
download | gitpython-18c777bf815357663226fd6834c8b1bcfe9b7b62.tar.gz |
Merge pull request #1282 from Yobmod/main
Start adding types to Submodule, add py.typed to manifest
Diffstat (limited to 'git/index/base.py')
-rw-r--r-- | git/index/base.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/git/index/base.py b/git/index/base.py index e2b3f8fa..f4ffba7b 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -3,7 +3,7 @@ # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -from git.refs.reference import Reference + import glob from io import BytesIO import os @@ -74,6 +74,8 @@ from git.types import PathLike, TBD if TYPE_CHECKING: from subprocess import Popen from git.repo import Repo + from git.refs.reference import Reference + from git.util import Actor StageType = int @@ -966,8 +968,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): return out - def commit(self, message: str, parent_commits=None, head: bool = True, author: str = None, - committer: str = None, author_date: str = None, commit_date: str = None, + def commit(self, message: str, parent_commits=None, head: bool = True, author: Union[None, 'Actor'] = None, + committer: Union[None, 'Actor'] = None, author_date: str = None, commit_date: str = None, skip_hooks: bool = False) -> Commit: """Commit the current default index file, creating a commit object. For more information on the arguments, see tree.commit. @@ -1191,7 +1193,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): assert "Should not reach this point" @default_index - def reset(self, commit: Union[Commit, Reference, str] = 'HEAD', working_tree: bool = False, + def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree: bool = False, paths: Union[None, Iterable[PathLike]] = None, head: bool = False, **kwargs: Any) -> 'IndexFile': """Reset the index to reflect the tree at the given commit. This will not |