mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +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/Reset.cs
Normal file
33
src/Commands/Reset.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue