VCS: Fix second line commit message verification

For commit messages consisting of only two lines, no
warning was shown when the second line was not empty.

Now a warning is print for:

 First
 Second
 Third

as well as:

 First
 Second

Change-Id: Ibf19bc46465446f1634f9fdc783bd194b837d5ec
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2021-04-17 14:39:20 +02:00
committed by André Hartmann
parent e6c28a7844
commit 3d4b5c0269

View File

@@ -519,8 +519,10 @@ void SubmitEditorWidget::verifyDescription()
int secondLineLength = 0;
if (subjectLength >= 0) {
const int secondLineStart = subjectLength + 1;
secondLineLength = d->m_description.indexOf(newLine, secondLineStart)
- secondLineStart;
int secondLineEnd = d->m_description.indexOf(newLine, secondLineStart);
if (secondLineEnd == -1)
secondLineEnd = descriptionLength;
secondLineLength = secondLineEnd - secondLineStart;
} else {
subjectLength = descriptionLength;
}