Open hcwang opened 9 months ago
Thanks for raising the issue! I just checked and this code works:
from pydriller import Repository
for commit in Repository("test-repos/small_repo", only_no_merge=True).traverse_commits():
print(commit.lines)
print(commit.files)
but this code doesn't work:
commits = list(Repository("test-repos/small_repo",only_no_merge=True).traverse_commits())
commits[0].files
commits[0].lines
Not sure why, we'll have to check. I will put this issue as a bug and PR are welcome
The reason is that the object is inside a context manager, so it will get destroyed after the loop.
I don't see a good solution to this, other than just iterating over the commits rather than putting them in a list.
Describe the bug
After upgrade from 2.5 to 2.5.1, the below code will raise exception.
To Reproduce
The below code:
will raise:
OS Version:
no-arch