Skip to content

Commit e6bee43

Browse files
committed
Add final types to commit.py
1 parent 476f4de commit e6bee43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎git/objects/commit.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def iter_items(cls, repo: 'Repo', rev: Union[str, 'Commit', 'SymbolicReference']
282282
proc = repo.git.rev_list(rev, args_list, as_process=True, **kwargs)
283283
return cls._iter_from_process_or_stream(repo, proc)
284284

285-
def iter_parents(self, paths: Union[PathLike, Sequence[PathLike]] = '', **kwargs) -> Iterator['Commit']:
285+
def iter_parents(self, paths: Union[PathLike, Sequence[PathLike]] = '', **kwargs: Any) -> Iterator['Commit']:
286286
"""Iterate _all_ parents of this commit.
287287
288288
:param paths:
@@ -362,7 +362,7 @@ def _iter_from_process_or_stream(cls, repo: 'Repo', proc_or_stream: Union[Popen,
362362
def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str,
363363
parent_commits: Union[None, List['Commit']] = None, head: bool = False,
364364
author: Union[None, Actor] = None, committer: Union[None, Actor] = None,
365-
author_date: Union[None, str] = None, commit_date: Union[None, str] = None):
365+
author_date: Union[None, str] = None, commit_date: Union[None, str] = None) -> 'Commit':
366366
"""Commit the given tree, creating a commit object.
367367
368368
:param repo: Repo object the commit should be part of
@@ -403,7 +403,7 @@ def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str,
403403
else:
404404
for p in parent_commits:
405405
if not isinstance(p, cls):
406-
raise ValueError("Parent commit '%r' must be of type %s" % (p, cls))
406+
raise ValueError(f"Parent commit '{p!r}' must be of type {cls}")
407407
# end check parent commit types
408408
# END if parent commits are unset
409409

0 commit comments

Comments
 (0)