refactor<*>: rewrite all codes...

This commit is contained in:
leo 2021-04-29 20:05:55 +08:00
parent 89ff8aa744
commit 30ab8ae954
342 changed files with 17208 additions and 19633 deletions

33
src/Commands/Reset.cs Normal file
View file

@ -0,0 +1,33 @@
using System.Collections.Generic;
using System.Text;
namespace SourceGit.Commands {
/// <summary>
/// 重置命令
/// </summary>
public class Reset : Command {
public Reset(string repo) {
Cwd = repo;
Args = "reset";
}
public Reset(string repo, string revision, string mode) {
Cwd = repo;
Args = $"reset {mode} {revision}";
}
public Reset(string repo, List<string> files) {
Cwd = repo;
StringBuilder builder = new StringBuilder();
builder.Append("reset --");
foreach (var f in files) {
builder.Append(" \"");
builder.Append(f);
builder.Append("\"");
}
Args = builder.ToString();
}
}
}