forked from qt-creator/qt-creator
VCS: Refactor fileNameFromDiffSpecification
Use diff file pattern to match file name. Avoid duplication. Include unit tests for Git Change-Id: Ib68a08368270a27976a3e16bdd1cb219a52b8889 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
57ee50d52f
commit
7b39f41c05
@@ -116,7 +116,7 @@ DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const
|
||||
{
|
||||
// Do not match on git "--- a/" as a deleted line, check
|
||||
// file first
|
||||
if (m_filePattern.exactMatch(text))
|
||||
if (m_filePattern.indexIn(text) == 0)
|
||||
return DiffFileFormat;
|
||||
if (text.startsWith(m_diffInIndicator))
|
||||
return DiffInFormat;
|
||||
|
||||
Reference in New Issue
Block a user