libgit2 / libgit2/libgit2sharp

Commands.Stage() fails with a submodule

Đang mở
#1,877 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
  1. Add a submodule to a Git repository like git submodule add ../test-module test-module
  2. Change the commit of the submodule like cd test-module; git checkout -b branch-name
  3. Try to stage the submodule using libgit2sharp with Commands.Stage("*") or with Commands.Stage("test-module")
Expected behavior

The submodule change should be staged.

Actual behavior

An exception is thrown because git_index_add_bypath() failed because the path is invalid: test-module/

Commands.Stage() adds a slash at the end of the submodule name it passes to git_index_add_bypath which causes it to fail. git_index_add_bypath works fine passing it test-module directly with repo.Index.Add("test-module") (which is a workaround I'll use for now).

Version of LibGit2Sharp (release number or SHA1)

LibGit2Sharp 0.26.2

Operating system(s) tested; .NET runtime tested

.NET Framework 4.7.2 on Windows 10

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 từ điểm vào Commands.Stage và tái hiện trường hợp submodule được mô tả bằng Commands.Stage("*") và Commands.Stage("test-module"). So sánh cách xử lý đường dẫn của nó với repo.Index.Add("test-module"), vốn được báo cáo là workaround. Hoàn thành khi có thể stage submodule đã thay đổi mà không gặp lỗi đường dẫn có dấu gạch chéo ở cuố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
tooling
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 tả rõ ràng
Mức phù hợp với người mới
45/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.