Does Repository.walk traverse all commits

399 views Asked by At

In pygit2, Repository.walk can be used to traverse commits starting from a commit.

However the docs do not explictly say whether all commits in the repository will be traversed, including dangling commits, or just the parents and children of the starting commit.

If this does not include dangling commits, is there anything I can do to traverse them?

1

There are 1 answers

0
simonzack On BEST ANSWER

Found relevant material in this answer.

Repository.walk does not care about dangling commits, however git_odb_foreach can be used, which in pygit2 terms simply translates to iterating the repository object (check the Repository_as_iter function).