summaryrefslogtreecommitdiff
path: root/git/objects
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-31 19:08:29 +0100
committerYobmod <yobmod@gmail.com>2021-07-31 19:08:29 +0100
commite6bee43b97862182d6c30bc8200f6abd1ff759e5 (patch)
tree99f8549f2a814d8dc46d8b2a1475588e8c2b284c /git/objects
parent476f4de6aa893bc0289c345a7d06b85256ab98bc (diff)
downloadgitpython-e6bee43b97862182d6c30bc8200f6abd1ff759e5.tar.gz
Add final types to commit.py
Diffstat (limited to 'git/objects')
-rw-r--r--git/objects/commit.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py
index 9d709656..b689167f 100644
--- a/git/objects/commit.py
+++ b/git/objects/commit.py
@@ -282,7 +282,7 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable):
proc = repo.git.rev_list(rev, args_list, as_process=True, **kwargs)
return cls._iter_from_process_or_stream(repo, proc)
- def iter_parents(self, paths: Union[PathLike, Sequence[PathLike]] = '', **kwargs) -> Iterator['Commit']:
+ def iter_parents(self, paths: Union[PathLike, Sequence[PathLike]] = '', **kwargs: Any) -> Iterator['Commit']:
"""Iterate _all_ parents of this commit.
:param paths:
@@ -362,7 +362,7 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable):
def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str,
parent_commits: Union[None, List['Commit']] = None, head: bool = False,
author: Union[None, Actor] = None, committer: Union[None, Actor] = None,
- author_date: Union[None, str] = None, commit_date: Union[None, str] = None):
+ author_date: Union[None, str] = None, commit_date: Union[None, str] = None) -> 'Commit':
"""Commit the given tree, creating a commit object.
:param repo: Repo object the commit should be part of
@@ -403,7 +403,7 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable):
else:
for p in parent_commits:
if not isinstance(p, cls):
- raise ValueError("Parent commit '%r' must be of type %s" % (p, cls))
+ raise ValueError(f"Parent commit '{p!r}' must be of type {cls}")
# end check parent commit types
# END if parent commits are unset