mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 13:14:59 +00:00
code_review: PR #692
* remove unnecessary namespace using * move `Commands.Branch.HasRemote` to `Commands.Remote.HasBranch` * remove `Commands.Branch.DeleteRemoteTracking` and check branch in `Commands.Branch.DeleteRemote` directly Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
8935bdd4c9
commit
fd5c1f5105
3 changed files with 24 additions and 50 deletions
|
@ -45,5 +45,14 @@
|
|||
Args = "remote set-url" + (isPush ? " --push " : " ") + $"{name} {url}";
|
||||
return Exec();
|
||||
}
|
||||
|
||||
public bool HasBranch(string remote, string branch)
|
||||
{
|
||||
SSHKey = new Config(WorkingDirectory).Get($"remote.{remote}.sshkey");
|
||||
Args = $"ls-remote {remote} {branch}";
|
||||
|
||||
var rs = ReadToEnd();
|
||||
return rs.IsSuccess && rs.StdOut.Trim().Length > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue