libgit2 / libgit2/libgit2sharp

Internal ArgumentNullException during Repository.Reset

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

We have a tool that regularly runs on a repository to migrate changes between several different repositories. As a part of the process, we do a soft reset of a submodule, which periodically (around one time per week) fails with an ArgumentNullException:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: SafeHandle cannot be null.
    mscorlib.dll!System.StubHelpers.StubHelpers.SafeHandleAddRef(System.Runtime.InteropServices.SafeHandle pHandle, ref bool success) Line 1664
    LibGit2Sharp.dll!LibGit2Sharp.Core.Proxy.git_reset(LibGit2Sharp.Core.Handles.RepositorySafeHandle repo, LibGit2Sharp.ObjectId committishId, LibGit2Sharp.ResetMode resetKind, ref LibGit2Sharp.Core.GitCheckoutOpts checkoutOptions) Line 2615
    LibGit2Sharp.dll!LibGit2Sharp.Repository.Reset(LibGit2Sharp.ResetMode resetMode, LibGit2Sharp.Commit commit, LibGit2Sharp.CheckoutOptions opts) Line 1002
    LibGit2Sharp.dll!LibGit2Sharp.Repository.Reset(LibGit2Sharp.ResetMode resetMode, LibGit2Sharp.Commit commit) Line 985

Unfortunately, I do not have a specific repo; every time this happens a rerun works properly again.

Version Consumed: 0.22. I'm not aware of this happening in an earlier version, but we had enough bugs in the tool itself that it's quite possible we never picked this up in the noise.

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 Repository.Reset và lời gọi Proxy.git_reset được hiển thị trong stack trace, sử dụng ngữ cảnh LibGit2Sharp 0.22 đã nêu. Điều tra cách repository handle và các đầu vào soft-reset được truyền trong quá trình reset submodule; issue không cung cấp một repository có thể tái hiện, vì vậy để hoàn thành cần cô lập nguyên nhân của null-handle xảy ra không liên tục và xác minh rằng reset không còn ném exception.

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ó
4/5
Thời gian dự kiến
3-5 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.