feature<TextDiffView>: supports discard changes from staged directly

This commit is contained in:
leo 2024-02-29 10:59:59 +08:00
parent 1149c768d3
commit 096fd6cb22
3 changed files with 66 additions and 2 deletions

18
src/Commands/Restore.cs Normal file
View file

@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Text;
namespace SourceGit.Commands {
public class Restore : Command {
public Restore(string repo, List<string> files, string extra) {
WorkingDirectory = repo;
Context = repo;
StringBuilder builder = new StringBuilder();
builder.Append("restore ");
if (!string.IsNullOrEmpty(extra)) builder.Append(extra).Append(" ");
builder.Append("--");
foreach (var f in files) builder.Append(' ').Append('"').Append(f).Append('"');
Args = builder.ToString();
}
}
}