-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathRestore.cs
30 lines (27 loc) · 877 Bytes
/
Restore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections.Generic;
using System.Text;
namespace SourceGit.Commands
{
public class Restore : Command
{
public Restore(string repo)
{
WorkingDirectory = repo;
Context = repo;
Args = "restore . --source=HEAD --staged --worktree --recurse-submodules";
}
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();
}
}
}