!24 右键菜单增加取消追踪,并在删除相关的远程分支时自动取消跟踪

Merge pull request !24 from Jai/feature/unset-upstream
This commit is contained in:
ZCShou 2021-09-08 00:19:36 +00:00 committed by Gitee
commit 50fe327a89
5 changed files with 37 additions and 7 deletions

View file

@ -21,7 +21,12 @@ namespace SourceGit.Commands {
}
public void SetUpstream(string upstream) {
Args = $"branch {target} -u {upstream}";
Args = $"branch {target} ";
if (string.IsNullOrEmpty(upstream)) {
Args += "--unset-upstream";
} else {
Args += $"-u {upstream}";
}
Exec();
}