libgit2 / libgit2/libgit2sharp
Repository.Init wants to write to workingDirectoryPath
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
Run the following code with workingDirectoryPath set to a write-protected directory path and gitDirectoryPath set to a writable directory path:
Lib2GitSharp.Repository.Init(workingDirectoryPath: "/", gitDirectoryPath: "/some/dir/.git")
Expected behavior
The Init() call works exactly as this git command: git --git-dir /some/dir/.git --work-tree /:
- it creates a .git repository directory at
/some/dir/.gitwith its config'score.worktreeset to/ - it does not touch the
--work-treedirectory/in any way and thus does not need write permissions in this directory
Actual behavior
An Exception of type Lib2GitException is thrown:failed to initialize repository with template '.git': Permission denied
Version of LibGit2Sharp (release number or SHA1)
0.26.2 (NuGet)
Operating system(s) tested; .NET runtime tested
Linux 5.9.14-arch1-1 #1 SMP PREEMPT Sat, 12 Dec 2020 14:37:12 +0000 x86_64 GNU/Linux
Microsoft.NETCore.App 3.1.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 Repository.Init và tái hiện sự cố với một workingDirectoryPath được bảo vệ chống ghi và một gitDirectoryPath có thể ghi. Được xem là hoàn tất khi quá trình khởi tạo tạo repository và đặt core.worktree thành thư mục làm việc mà không cố gắng ghi vào đó, phù hợp với hành vi lệnh git đã nêu.
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
- api, backend
- 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
- 35/100