libgit2 / libgit2/libgit2sharp

Exception: "An item with the same key has already been added" when comparing commits

Đang mở
#1,418 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C#
Star
3.5k
Fork
925
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I get ArgumentException when comparing two commits from https://github.com/shageman/the_next_big_thing with v.0.23.1.0

 System.ArgumentException:`  An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at LibGit2Sharp.Patch.AddFileChange(git_diff_delta* delta) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Patch.cs:line 54
   at LibGit2Sharp.Patch..ctor(DiffHandle diff) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Patch.cs:line 43
   at LibGit2Sharp.Diff.<.cctor>b__1b(DiffHandle diff) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 104
   at LibGit2Sharp.Diff.BuildDiffResult[T](DiffHandle diff) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 120
   at LibGit2Sharp.Diff.Compare[T](Tree oldTree, Tree newTree, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions, CompareOptions compareOptions) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 253
   at LibGit2Sharp.Diff.Compare[T](Tree oldTree, Tree newTree) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 157

The code I'am using:
this.repository.Diff.Compare<Patch>(commitB.Tree, commitA.Tree);

commitA: a9a82df96ab1f73c69b2668b91eda31e672bbf98 Move rails application back to root to make heroku deployment work again
commitB: ede0b0c359d5af516889563bebafd51b7f43115a Gemnasium doesn't recognize Gemfile when its not in the root. Let's try symlinks

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với LibGit2Sharp/Patch.cs tại AddFileChange và xem xét đường dẫn gọi từ Diff.cs trong quá trình Diff.Compare. Tái hiện phép so sánh bằng các commit a9a82df96ab1f73c69b2668b91eda31e672bbf98 và ede0b0c359d5af516889563bebafd51b7f43115a. Hoàn thành khi phép so sánh này không còn ném ArgumentException do khóa trùng lặp và trả về các thay đổi patch như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, git
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.