libgit2 / libgit2/libgit2sharp
Exception: "An item with the same key has already been added" while comparing commits
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 3.5k
- 分支
- 925
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Reproduction steps
repository.Diff.Compare<Patch>(commitB.Tree, commitA.Tree);
Expected behavior
patch
Actual behavior
"exception": "System.ArgumentException: An item with the same key has already been added. Key: tools/firmware-utils/src/bcm_tag.h\n at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\n at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\n at LibGit2Sharp.Patch..ctor(DiffHandle diff)\n at LibGit2Sharp.Diff.u003cu003ec.u003c.cctoru003eb__36_0(DiffHandle diff)\n at LibGit2Sharp.Diff.BuildDiffResult[T](DiffHandle diff)\n at LibGit2Sharp.Diff.Compare[T](Tree oldTree, Tree newTree, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions, CompareOptions compareOptions)\n at
Version of LibGit2Sharp (release number or SHA1)
libgit2sharp/0.26.2
Operating system(s) tested; .NET runtime tested
ubuntu docker mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先,使用回報的提交重現 repository.Diff.Compare< Patch >(commitB.Tree, commitA.Tree),並檢查經過 Diff.Compare 和 LibGit2Sharp.Patch 的堆疊追蹤。檢查重複路徑 tools/firmware-utils/src/bcm_tag.h 的處理方式;當比較傳回 patch 而不是擲出重複鍵例外時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp, git
- 領域
- devtools
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100