Commit 51a9d506 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

VCS: Support chunks without comma

Git submodule is reported as @@ -1 +1 @@

Change-Id: Ic7a619b0f4c8eb505b75529501dcd18723de2465
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 84cbd101
......@@ -1078,8 +1078,11 @@ static inline bool checkChunkLine(const QString &line, int *modifiedLineNumber,
return false;
const int lineNumberPos = plusPos + 1;
const int commaPos = line.indexOf(QLatin1Char(','), lineNumberPos);
if (commaPos == -1 || commaPos > endPos)
return false;
if (commaPos == -1 || commaPos > endPos) {
// Git submodule appears as "@@ -1 +1 @@"
*modifiedLineNumber = 1;
return true;
}
const QString lineNumberStr = line.mid(lineNumberPos, commaPos - lineNumberPos);
bool ok;
*modifiedLineNumber = lineNumberStr.toInt(&ok);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment