libgit2 / libgit2/libgit2sharp
FullHistory method of FileHistory class, doesn't return actual history
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
Code:
var _repository = new Repository(@"D:\11");
var commitFilter = new CommitFilter { SortBy = CommitSortStrategies.Topological };
var sdf = _repository.Commits.QueryBy("SPF 711 performance", commitFilter).Select(c => c.Commit).ToList();
doesn't return history, while existing of 7 commits.

Inside the method FullHistory iterating through commits stops when reaching commit
4bf4edccaa9ce3b7f785b14939a3545c627b5dfd because of this code:
var currentTreeEntry = currentCommit.Tree[currentPath];
if (currentTreeEntry == null)
{
yield break;
}
looks like iterator cannot achieve commits which contain a history of the file because of the running into the commit which knows nothing about the file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate FileHistory.FullHistory and reproduce the issue with the shown Repository and CommitFilter against the seven-commit history. Trace the iteration at commit 4bf4edccaa9ce3b7f785b14939a3545c627b5dfd and verify that the method returns the complete file history instead of stopping when currentTreeEntry is null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100