mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
Add option --ignore-whitespace
supports for git apply
command
This commit is contained in:
parent
95030c334f
commit
5df377e48e
3 changed files with 23 additions and 6 deletions
|
@ -502,11 +502,16 @@ namespace SourceGit.Git {
|
|||
/// Apply patch.
|
||||
/// </summary>
|
||||
/// <param name="patch"></param>
|
||||
/// <param name="ignoreSpaceChanges"></param>
|
||||
/// <param name="whitespaceMode"></param>
|
||||
public void Apply(string patch, string whitespaceMode) {
|
||||
public void Apply(string patch, bool ignoreSpaceChanges, string whitespaceMode) {
|
||||
isWatcherDisabled = true;
|
||||
|
||||
var errs = RunCommand($"apply --whitespace={whitespaceMode} \"{patch}\"", null);
|
||||
var args = "apply ";
|
||||
if (ignoreSpaceChanges) args += "--ignore-whitespace ";
|
||||
else args += $"--whitespace={whitespaceMode} ";
|
||||
|
||||
var errs = RunCommand($"{args} \"{patch}\"", null);
|
||||
if (errs != null) {
|
||||
App.RaiseError(errs);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue