From 82b131cf2afebbed3723df5b5dfd5cd820716f97 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Wed, 30 Jun 2021 18:41:06 +0100 Subject: Type Traversable.traverse() better, start types of submodule --- git/index/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git/index') diff --git a/git/index/base.py b/git/index/base.py index e2b3f8fa..debd710f 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,7 @@ from git.types import PathLike, TBD if TYPE_CHECKING: from subprocess import Popen from git.repo import Repo + from git.refs.reference import Reference StageType = int @@ -1191,7 +1192,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 -- cgit v1.2.1 From 02b8ef0f163ca353e27f6b4a8c2120444739fde5 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Thu, 1 Jul 2021 10:35:11 +0100 Subject: Add missed types to Commit, uncomment to_native_path_linux() --- git/index/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git/index') diff --git a/git/index/base.py b/git/index/base.py index debd710f..f4ffba7b 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -75,6 +75,7 @@ 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 @@ -967,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. -- cgit v1.2.1