libgit2 / libgit2/libgit2sharp
Worktrees.Add throws an exception if a slash is in the branch name
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
have a repository with the branches
- main [default]
- feature/branch-name
Clone the repository and add the worktree.
SourceCode:
var cloneOptions = new CloneOptions()
{
CredentialsProvider = (_url, _user, _cred) => this.Credentials,
Checkout = true,
RecurseSubmodules = true,
};
this.gitRepositoryPath = Repository.Clone(this.SourceUrl, this.WorkdirPath, cloneOptions);
using (var repo = new Repository(this.gitRepositoryPath))
{
var path = Path.Combine(this.WorkdirPath, "..", this.Branch);
repo.Worktrees.Add(this.Branch, path, false);
}
Expected behavior
Worktree should be created
Actual behavior
Exception is thrown:
failed to make directory 'xxx/.git/worktrees/feature/branch-name': The system cannot find the path specified.
Version of LibGit2Sharp (release number or SHA1)
0,26, 0.27.0-preview-0182
Operating system(s) tested; .NET runtime tested
Windows 10, Windows Server 2016, .Net Framework 4.8
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu tại điểm vào Worktrees.Add và tái hiện lỗi với branch feature/branch-name được mô tả trong issue trên Windows. Theo dõi quá trình tạo thư mục worktree và xác minh rằng việc thêm một branch chứa dấu gạch chéo hoàn tất mà không xảy ra ngoại lệ được báo cáo.
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, 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
- Khá rõ ràng
- Mức phù hợp với người mới
- 40/100