sourcegit/src/SourceGit/Commands/Apply.cs

16 lines
529 B
C#
Raw Normal View History

namespace SourceGit.Commands
{
public class Apply : Command
{
public Apply(string repo, string file, bool ignoreWhitespace, string whitespaceMode, string extra)
{
WorkingDirectory = repo;
Context = repo;
2021-04-29 05:05:55 -07:00
Args = "apply ";
if (ignoreWhitespace) Args += "--ignore-whitespace ";
else Args += $"--whitespace={whitespaceMode} ";
if (!string.IsNullOrEmpty(extra)) Args += $"{extra} ";
2021-04-29 05:05:55 -07:00
Args += $"\"{file}\"";
}
}
}