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 <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2021-09-09 15:07:44 +02:00
committed by André Hartmann
parent 5d1d6c83a4
commit 4da225f7af

View File

@@ -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."));