mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
code_style: allowEmpty
is not needed any more
This commit is contained in:
parent
93e964dcb6
commit
077e35b860
3 changed files with 4 additions and 6 deletions
|
@ -4,7 +4,7 @@ namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
public class Commit : Command
|
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();
|
var file = Path.GetTempFileName();
|
||||||
File.WriteAllText(file, message);
|
File.WriteAllText(file, message);
|
||||||
|
@ -12,11 +12,9 @@ namespace SourceGit.Commands
|
||||||
WorkingDirectory = repo;
|
WorkingDirectory = repo;
|
||||||
Context = repo;
|
Context = repo;
|
||||||
TraitErrorAsOutput = true;
|
TraitErrorAsOutput = true;
|
||||||
Args = $"commit --file=\"{file}\"";
|
Args = $"commit --allow-empty --file=\"{file}\"";
|
||||||
if (amend)
|
if (amend)
|
||||||
Args += " --amend --no-edit";
|
Args += " --amend --no-edit";
|
||||||
if (allowEmpty)
|
|
||||||
Args += " --allow-empty";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
return Task.Run(() =>
|
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));
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||||
return succ;
|
return succ;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1311,7 +1311,7 @@ namespace SourceGit.ViewModels
|
||||||
succ = new Commands.Add(_repo.FullPath, _repo.IncludeUntracked).Exec();
|
succ = new Commands.Add(_repo.FullPath, _repo.IncludeUntracked).Exec();
|
||||||
|
|
||||||
if (succ)
|
if (succ)
|
||||||
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend, true).Exec();
|
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend).Exec();
|
||||||
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue