ux: disable commit button when commit message is empty

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-08 18:03:40 +08:00
parent 7cda7211f1
commit da38b72ee5
No known key found for this signature in database
3 changed files with 31 additions and 11 deletions

View file

@ -1652,6 +1652,9 @@ namespace SourceGit.ViewModels
private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty = false, bool confirmWithFilter = false)
{
if (string.IsNullOrWhiteSpace(_commitMessage))
return;
if (!_repo.CanCreatePopup())
{
App.RaiseException(_repo.FullPath, "Repository has unfinished job! Please wait!");
@ -1672,12 +1675,6 @@ namespace SourceGit.ViewModels
return;
}
if (string.IsNullOrWhiteSpace(_commitMessage))
{
App.RaiseException(_repo.FullPath, "Commit without message is NOT allowed!");
return;
}
if (!_useAmend && !allowEmpty)
{
if ((autoStage && _count == 0) || (!autoStage && _staged.Count == 0))