libgit2 / libgit2/libgit2sharp
KeyNotFoundException when trying to iterate through QueryBy result set.
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to get all commits that a particular file is associated with. This is the code that I'm running:
IEnumerable<LogEntry> fileHistory = repo.Commits.QueryBy(fileRelativePath);
foreach (LogEntry version in fileHistory){
// do something...
}
The foreach throws a KeyNotFoundException. Any idea on how to overcome this?
I'm using: LibGit2Sharp.0.23.1
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
Start by reproducing the shown repo.Commits.QueryBy(fileRelativePath) call with LibGit2Sharp 0.23.1 and capture where iteration raises KeyNotFoundException. Inspect the QueryBy result path and its handling of the returned commits; done means the file history can be iterated without the exception and the behavior is covered by a regression test.
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
- Needs clarification
- Newbie friendliness
- 25/100