mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
28 lines
676 B
C#
28 lines
676 B
C#
|
using System.Collections.Generic;
|
||
|
using System.Text;
|
||
|
|
||
|
namespace SourceGit.Commands {
|
||
|
/// <summary>
|
||
|
/// `git add`命令
|
||
|
/// </summary>
|
||
|
public class Add : Command {
|
||
|
public Add(string repo) {
|
||
|
Cwd = repo;
|
||
|
Args = "add .";
|
||
|
}
|
||
|
|
||
|
public Add(string repo, List<string> paths) {
|
||
|
StringBuilder builder = new StringBuilder();
|
||
|
builder.Append("add --");
|
||
|
foreach (var p in paths) {
|
||
|
builder.Append(" \"");
|
||
|
builder.Append(p);
|
||
|
builder.Append("\"");
|
||
|
}
|
||
|
|
||
|
Cwd = repo;
|
||
|
Args = builder.ToString();
|
||
|
}
|
||
|
}
|
||
|
}
|