libgit2 / libgit2/libgit2sharp
Repositories with git-dir and work-dir should't create .git file in working directory
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
Repository.Init("/working/path", "/git/path");
Expected behavior
For most cases the whole point of doing this separation of working directory and git directory is to avoid the existence of .git file/folder in working directory
Actual behavior
The repo_is_worktree in repository.c of libgit2, should not checking for gitdir in working directory.
In config file, in git directory there is a field worktree = /working/path which could be used to find out which is the working directory.
My suggestion would be, in private Repository constructor to get the worktree value from config file in git-directory and pass it to the Proxy.git_repository_set_workdir in Repository class
instead of reading the value from options that were given from caller.
Future improvement would be not event passing the working directory, because it can be extracted from config file.
Hope to hear soon your opinion on this
Max
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 với Repository.Init và hàm khởi tạo riêng tư của Repository, sau đó kiểm tra Repository.cs xung quanh Proxy.git_repository_set_workdir. So sánh đường dẫn đó với repo_is_worktree và cách xử lý gitdir trong src/repository.c, sử dụng giá trị worktree trong cấu hình thư mục Git như được mô tả. Tái hiện vấn đề với các đường dẫn làm việc và Git riêng biệt, đồng thời xác nhận rằng quá trình khởi tạo không còn tạo tệp .git trong thư mục làm việc.
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ó
- 4/5
- Thời gian dự kiến
- 3-5 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
- 35/100