libgit2 / libgit2/libgit2sharp
Pushing new branches does not set up tracking branch completely
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ả
When you push a local branch that does not exist on the remote (using the refspec overload), libgit2sharp automatically creates a tracking branch, but it does not set up the config for the local branch
i.e. the following config entries are missing:
branch.(branch_name).remote
branch.(branch_name).merge
Currently, I push a new branch like as follows:
string refspec = string.Format("{0}:{1}",
currentBranch.CanonicalName, currentBranch.CanonicalName);
repo.Network.Push(remote, refspec, handler, credentials);
repo.Branches.Update(repo.Head, delegate(BranchUpdater updater)
{
updater.Remote = remote.Name;
updater.UpstreamBranch = repo.Head.CanonicalName;
});
I feel like this should be simplified. Either by doing the BranchUpdater stuff in Push(), or by extending the Push(Branch, ...) overload to let it accept non-tracking branches and do the whole process.
I also did not find a test fixture covering that feature, so the intended behaviour should at least be specified.
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 bằng cách đọc các overload của Push và cách sử dụng BranchUpdater được nêu trong issue, sau đó kiểm tra các test fixture push hiện có vì issue cho biết không có fixture nào bao phủ hành vi này. Công việc được xem là hoàn tất khi đường dẫn push được hỗ trợ cho branch mới thiết lập cấu hình branch.remote và branch.merge, kèm theo một test chỉ rõ hành vi dự kiến.
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
- 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
- 38/100