Files
sourcegit/src/Commands/Add.cs
2025-06-02 22:38:00 +08:00

27 lines
681 B
C#

namespace SourceGit.Commands
{
public class Add : Command
{
public Add(string repo, bool includeUntracked)
{
WorkingDirectory = repo;
Context = repo;
Args = includeUntracked ? "add ." : "add -u .";
}
public Add(string repo, Models.Change change)
{
WorkingDirectory = repo;
Context = repo;
Args = $"add -- \"{change.Path}\"";
}
public Add(string repo, string pathspecFromFile)
{
WorkingDirectory = repo;
Context = repo;
Args = $"add --pathspec-from-file=\"{pathspecFromFile}\"";
}
}
}