VCS: Support chunks without comma

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

Change-Id: Ic7a619b0f4c8eb505b75529501dcd18723de2465
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-07-09 22:34:44 +03:00
committed by Orgad Shaneh
parent 84cbd1017a
commit 51a9d5065a

View File

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