Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在pygit2,Repository.walk可用于从提交开始遍历提交。
pygit2
Repository.walk
但是,文档没有明确说明是否将遍历存储库中的所有提交,包括悬空提交,或者只是开始提交的父级和子级。
如果这不包括悬空提交,我能做些什么来遍历它们吗?
在这个答案中找到了相关材料。
Repository.walk不关心悬空提交,但是git_odb_foreach可以使用,它pygit2简单地转换为迭代存储库对象(检查Repository_as_iter函数)。
git_odb_foreach
Repository_as_iter