Skip to content

Commit 077e35b

Browse files
committed
code_style: allowEmpty is not needed any more
1 parent 93e964d commit 077e35b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/Commands/Commit.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ namespace SourceGit.Commands
44
{
55
public class Commit : Command
66
{
7-
public Commit(string repo, string message, bool amend, bool allowEmpty = false)
7+
public Commit(string repo, string message, bool amend)
88
{
99
var file = Path.GetTempFileName();
1010
File.WriteAllText(file, message);
1111

1212
WorkingDirectory = repo;
1313
Context = repo;
1414
TraitErrorAsOutput = true;
15-
Args = $"commit --file=\"{file}\"";
15+
Args = $"commit --allow-empty --file=\"{file}\"";
1616
if (amend)
1717
Args += " --amend --no-edit";
18-
if (allowEmpty)
19-
Args += " --allow-empty";
2018
}
2119
}
2220
}

src/ViewModels/Reword.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override Task<bool> Sure()
3939

4040
return Task.Run(() =>
4141
{
42-
var succ = new Commands.Commit(_repo.FullPath, _message, true, true).Exec();
42+
var succ = new Commands.Commit(_repo.FullPath, _message, true).Exec();
4343
CallUIThread(() => _repo.SetWatcherEnabled(true));
4444
return succ;
4545
});

src/ViewModels/WorkingCopy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty)
13111311
succ = new Commands.Add(_repo.FullPath, _repo.IncludeUntracked).Exec();
13121312

13131313
if (succ)
1314-
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend, true).Exec();
1314+
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend).Exec();
13151315

13161316
Dispatcher.UIThread.Post(() =>
13171317
{

0 commit comments

Comments
 (0)