mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
feature<TextDiffView>: supports discard changes from staged directly
This commit is contained in:
parent
1149c768d3
commit
096fd6cb22
3 changed files with 66 additions and 2 deletions
18
src/Commands/Restore.cs
Normal file
18
src/Commands/Restore.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue