mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
33
src/Commands/Branch.cs
Normal file
33
src/Commands/Branch.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
namespace SourceGit.Commands {
|
||||
/// <summary>
|
||||
/// 分支相关操作
|
||||
/// </summary>
|
||||
class Branch : Command {
|
||||
private string target = null;
|
||||
|
||||
public Branch(string repo, string branch) {
|
||||
Cwd = repo;
|
||||
target = branch;
|
||||
}
|
||||
|
||||
public void Create(string basedOn) {
|
||||
Args = $"branch {target} {basedOn}";
|
||||
Exec();
|
||||
}
|
||||
|
||||
public void Rename(string to) {
|
||||
Args = $"branch -M {target} {to}";
|
||||
Exec();
|
||||
}
|
||||
|
||||
public void SetUpstream(string upstream) {
|
||||
Args = $"branch {target} -u {upstream}";
|
||||
Exec();
|
||||
}
|
||||
|
||||
public void Delete() {
|
||||
Args = $"branch -D {target}";
|
||||
Exec();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue