Exception while trying to retrieve last commit from shallow repo

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

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu tại điểm vào Repository.Commits được hiển thị trong báo cáo và tái hiện lỗi với một repository được tạo bằng git clone --depth xx. So sánh việc liệt kê repository shallow với NotFoundException được báo cáo, sau đó xác minh rằng việc truy xuất commit đầu tiên thành công mà không gặp lỗi thiếu object. Issue không chỉ định file test cụ thể nào.

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

Mô tả

In my custom MSBuild task code tries to get last commit hash to put it into one of assembly attributes. Task works very well with repositories cloned with full depth but fails with the following error in repositories with limited depth created with command git clone --depth xx - where xx is number of last commits to clone.

/home/travis/build/DjvuNet/DjvuNet/DjvuNetBuild.Core.targets(20,5): error :
 LibGit2Sharp.NotFoundException: 
object not found - no match for id (d53e5a7166904479d42953bd0f91264f5ace1f6d)
[/home/travis/build/DjvuNet/DjvuNet/DjvuNet.NETStandard2.0/DjvuNet.NETStandard2.0.csproj] 

Code used to retrieve commit data is as follows:

    Repository repo = new Repository(RepoRoot);
    var commits = repo.Commits;
    var commit = commits.FirstOrDefault();

Seems to be libgit2sharp implementation bug as git fully supports enumeration of limited depth repos.

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

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.

Issue khác của libgit2/libgit2sharp

Tất cả issue của libgit2/libgit2sharp

Issue tương tự

Thêm issue về C#

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.