libgit2 / libgit2/libgit2sharp

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

Đang mở
#1,801 0 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ả

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

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 bằng cách tái hiện repository.Diff.Compare< Patch >(commitB.Tree, commitA.Tree) với các commit được báo cáo và xem xét stack trace qua Diff.Compare và LibGit2Sharp.Patch. Kiểm tra cách đường dẫn trùng lặp tools/firmware-utils/src/bcm_tag.h được xử lý; hoàn thành khi phép so sánh trả về một patch thay vì ném ra ngoại lệ khóa trùng lặp.

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
devtools
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
Cần làm rõ
Mức phù hợp với người mới
25/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.