Git: Fix parsing of "already merged" files in merge tool

If you have several files that require merging, and you externally resolve
(and git add) some of them, the following message appears:

foo.cpp: file does not need merging
Continue merging other unresolved paths [y/n]?

We don't identify the first line, so the second one is lost too.

Change-Id: I54c579910656c07be7e6b3236551257443fe8fb9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2017-02-23 13:10:45 +02:00
committed by Orgad Shaneh
parent 86f32f5b9c
commit 71c2352e4b

View File

@@ -212,6 +212,7 @@ void MergeTool::readData()
m_mergeType = mergeType(m_line.left(index)); m_mergeType = mergeType(m_line.left(index));
int quote = m_line.indexOf('\''); int quote = m_line.indexOf('\'');
m_fileName = QString::fromLocal8Bit(m_line.mid(quote + 1, m_line.lastIndexOf('\'') - quote - 1)); m_fileName = QString::fromLocal8Bit(m_line.mid(quote + 1, m_line.lastIndexOf('\'') - quote - 1));
m_line.clear();
} else if (m_line.startsWith(" {local}")) { } else if (m_line.startsWith(" {local}")) {
waitForFurtherInput = !hasLine; waitForFurtherInput = !hasLine;
if (waitForFurtherInput) if (waitForFurtherInput)
@@ -229,7 +230,11 @@ void MergeTool::readData()
prompt(tr("Unchanged File"), tr("Was the merge successful?")); prompt(tr("Unchanged File"), tr("Was the merge successful?"));
} else if (m_line.startsWith("Continue merging")) { } else if (m_line.startsWith("Continue merging")) {
prompt(tr("Continue Merging"), tr("Continue merging other unresolved paths?")); prompt(tr("Continue Merging"), tr("Continue merging other unresolved paths?"));
} else if (m_line.endsWith('\n')) {
// Skip unidentified lines
m_line.clear();
} }
} }
if (!waitForFurtherInput) if (!waitForFurtherInput)
m_line.clear(); m_line.clear();