mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 21:30:37 +08:00
enhance: allow edit commit message only with Amend (#336)
This commit is contained in:
@@ -1238,25 +1238,33 @@ namespace SourceGit.ViewModels
|
||||
App.RaiseException(_repo.FullPath, "Repository has unfinished job! Please wait!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_count == 0)
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "No files added to commit!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AutoStageBeforeCommit && _staged.Count == 0)
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "No files added to commit!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(_commitMessage))
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "Commit without message is NOT allowed!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_useAmend)
|
||||
{
|
||||
if (AutoStageBeforeCommit)
|
||||
{
|
||||
if (_count == 0)
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "No files added to commit!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_staged.Count == 0)
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "No files added to commit!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IsCommitting = true;
|
||||
_repo.Settings.PushCommitMessage(_commitMessage);
|
||||
_repo.SetWatcherEnabled(false);
|
||||
|
||||
Reference in New Issue
Block a user