From 44f0578f841c48bba6473e0890b8a3daae94c58e Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 19 Jul 2021 16:55:23 +0100 Subject: Make types in refs compatible with repo --- git/repo/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'git/repo/base.py') diff --git a/git/repo/base.py b/git/repo/base.py index 3214b528..29d08502 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -426,7 +426,7 @@ class Repo(object): For more documentation, please see the Head.create method. :return: newly created Head Reference""" - return Head.create(self, path, commit, force, logmsg) + return Head.create(self, path, commit, logmsg, force) def delete_head(self, *heads: 'SymbolicReference', **kwargs: Any) -> None: """Delete the given heads @@ -518,7 +518,7 @@ class Repo(object): repository = configuration file for this repository only""" return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self) - def commit(self, rev: Optional[str] = None + def commit(self, rev: Union[str, Commit_ish, None] = None ) -> Commit: """The Commit object for the specified revision @@ -551,7 +551,8 @@ class Repo(object): return self.head.commit.tree return self.rev_parse(str(rev) + "^{tree}") - def iter_commits(self, rev: Optional[TBD] = None, paths: Union[PathLike, Sequence[PathLike]] = '', + def iter_commits(self, rev: Union[str, Commit, 'SymbolicReference', None] = None, + paths: Union[PathLike, Sequence[PathLike]] = '', **kwargs: Any) -> Iterator[Commit]: """A list of Commit objects representing the history of a given ref/commit -- cgit v1.2.1