libgit2 / libgit2/libgit2sharp
TreeEntryChange status is set incorrectly when doing Diff (Deleted instead of Renamed)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
I took a diff between 42b22ab5fe78889aae058c3af342ea67b30b48d5 and e315208fe33d43964fb649935e3bbff2275fa101 which are two consecutive commits in Roslyn codebase. As you can see Github shows the status of all changes as renamed but libgit2sharp detects them as deleted.
Steps to reproduce:
- Clone Roslyn's repo
- Take a diff between these commits
foreach (TreeEntryChanges change in repo
.Diff.Compare<TreeChanges>(commitParents.Single().Tree, commit.Tree, compareOptions: compareOptions))
{
// for all chnages change.Status=ChangeKind.Deleted
}
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
Reproduce the diff between commits 42b22ab5fe78889aae058c3af342ea67b30b48d5 and e315208fe33d43964fb649935e3bbff2275fa101 using the shown TreeChanges comparison. Trace how TreeEntryChanges assigns ChangeKind for these changes; done means the affected entries report Renamed rather than Deleted.
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