diff --git a/SourceGit/Git/Repository.cs b/SourceGit/Git/Repository.cs
index 34397d7f..77d594dc 100644
--- a/SourceGit/Git/Repository.cs
+++ b/SourceGit/Git/Repository.cs
@@ -502,11 +502,16 @@ namespace SourceGit.Git {
/// Apply patch.
///
///
+ ///
///
- 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 {
diff --git a/SourceGit/UI/Apply.xaml b/SourceGit/UI/Apply.xaml
index 37cad8c7..5b15371a 100644
--- a/SourceGit/UI/Apply.xaml
+++ b/SourceGit/UI/Apply.xaml
@@ -5,14 +5,16 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="clr-namespace:SourceGit.Helpers"
+ xmlns:converters="clr-namespace:SourceGit.Converters"
mc:Ignorable="d"
- d:DesignHeight="192" d:DesignWidth="500" Height="160" Width="500">
+ Height="192" Width="500">
+
@@ -22,6 +24,10 @@
+
+
+
+
@@ -51,7 +57,7 @@
-
+
@@ -62,7 +68,12 @@
-
+
+
+
diff --git a/SourceGit/UI/Apply.xaml.cs b/SourceGit/UI/Apply.xaml.cs
index 1ce51199..e1452801 100644
--- a/SourceGit/UI/Apply.xaml.cs
+++ b/SourceGit/UI/Apply.xaml.cs
@@ -85,7 +85,8 @@ namespace SourceGit.UI {
PopupManager.Lock();
var mode = combWhitespaceOptions.SelectedItem as WhitespaceOption;
- await Task.Run(() => repo.Apply(PatchFile, mode.Arg));
+ var ignoreSpaceChanges = chkIgnoreWhitespace.IsChecked == true;
+ await Task.Run(() => repo.Apply(PatchFile, ignoreSpaceChanges, mode.Arg));
PopupManager.Close(true);
}