mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-22 10:55:00 +00:00
27 lines
676 B
C#
27 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();
|
|
}
|
|
}
|
|
}
|