Skip to content

Commit 0c8ca1a

Browse files
committed
Fix Repo.iter_commits docstring about return type
It had said it returned a list of Commit objects, but it returns an iterator of Commit objects.
1 parent 4f67369 commit 0c8ca1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: git/repo/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def iter_commits(
692692
paths: Union[PathLike, Sequence[PathLike]] = "",
693693
**kwargs: Any,
694694
) -> Iterator[Commit]:
695-
"""A list of Commit objects representing the history of a given ref/commit.
695+
"""An iterator of Commit objects representing the history of a given ref/commit.
696696
697697
:param rev:
698698
Revision specifier, see git-rev-parse for viable options.
@@ -708,7 +708,7 @@ def iter_commits(
708708
:note: To receive only commits between two named revisions, use the
709709
``"revA...revB"`` revision specifier.
710710
711-
:return: ``git.Commit[]``
711+
:return: Iterator of ``git.Commit``
712712
"""
713713
if rev is None:
714714
rev = self.head.commit

0 commit comments

Comments
 (0)