mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
fix<Discard>: fix discard with files not only dropped changes selected but also others
This commit is contained in:
parent
30ab8ae954
commit
8f3c2fdc32
4 changed files with 47 additions and 20 deletions
|
@ -1,3 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
/// <summary>
|
||||
/// 清理指令
|
||||
|
@ -8,5 +11,18 @@ namespace SourceGit.Commands {
|
|||
Cwd = repo;
|
||||
Args = "clean -qfd";
|
||||
}
|
||||
|
||||
public Clean(string repo, List<string> files) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.Append("clean -qfd --");
|
||||
foreach (var f in files) {
|
||||
builder.Append(" \"");
|
||||
builder.Append(f);
|
||||
builder.Append("\"");
|
||||
}
|
||||
|
||||
Cwd = repo;
|
||||
Args = builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue