diff --git a/src/Commands/Commit.cs b/src/Commands/Commit.cs index b629f82d..5927da51 100644 --- a/src/Commands/Commit.cs +++ b/src/Commands/Commit.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Commit : Command { - public Commit(string repo, string message, bool amend, bool allowEmpty = false) + public Commit(string repo, string message, bool amend) { var file = Path.GetTempFileName(); File.WriteAllText(file, message); @@ -12,11 +12,9 @@ namespace SourceGit.Commands WorkingDirectory = repo; Context = repo; TraitErrorAsOutput = true; - Args = $"commit --file=\"{file}\""; + Args = $"commit --allow-empty --file=\"{file}\""; if (amend) Args += " --amend --no-edit"; - if (allowEmpty) - Args += " --allow-empty"; } } } diff --git a/src/ViewModels/Reword.cs b/src/ViewModels/Reword.cs index 7ec873c8..3cd85d72 100644 --- a/src/ViewModels/Reword.cs +++ b/src/ViewModels/Reword.cs @@ -39,7 +39,7 @@ namespace SourceGit.ViewModels return Task.Run(() => { - var succ = new Commands.Commit(_repo.FullPath, _message, true, true).Exec(); + var succ = new Commands.Commit(_repo.FullPath, _message, true).Exec(); CallUIThread(() => _repo.SetWatcherEnabled(true)); return succ; }); diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index b5da419f..e45a1749 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -1311,7 +1311,7 @@ namespace SourceGit.ViewModels succ = new Commands.Add(_repo.FullPath, _repo.IncludeUntracked).Exec(); if (succ) - succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend, true).Exec(); + succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend).Exec(); Dispatcher.UIThread.Post(() => {