From 4da225f7af951c8fc3ddd841b185abfa5e3a79cb Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 9 Sep 2021 15:07:44 +0200 Subject: [PATCH] VCS: Fix commit message verification for empty subject For commit messages with empty subject and full body no warning was shown so far. Example: " This is now considered as commit message with a very short subject, but was valid before. " Change-Id: Iee24b022cd53dc9d2eb71f47571221e4dda9ba08 Reviewed-by: Orgad Shaneh --- src/plugins/vcsbase/submiteditorwidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/vcsbase/submiteditorwidget.cpp b/src/plugins/vcsbase/submiteditorwidget.cpp index 3c62a7d2732..e84a77ed502 100644 --- a/src/plugins/vcsbase/submiteditorwidget.cpp +++ b/src/plugins/vcsbase/submiteditorwidget.cpp @@ -539,11 +539,11 @@ void SubmitEditorWidget::verifyDescription() subjectLength = descriptionLength; } - enum { MaxSubjectLength = 72, WarningSubjectLength = 55 }; + enum { MinSubjectLength = 20, MaxSubjectLength = 72, WarningSubjectLength = 55 }; QStringList hints; QStringList toolTips; - if (descriptionLength < 20) - hints.append(warning + tr("Warning: The commit message is very short.")); + if (subjectLength < MinSubjectLength) + hints.append(warning + tr("Warning: The commit subject is very short.")); if (subjectLength > MaxSubjectLength) hints.append(warning + tr("Warning: The commit subject is too long."));