From 71c2352e4b4cafcfb228139db406d0ec8e3160d1 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 23 Feb 2017 13:10:45 +0200 Subject: [PATCH] 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 --- src/plugins/git/mergetool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp index f25b9fd2d9b..58b19b02f8a 100644 --- a/src/plugins/git/mergetool.cpp +++ b/src/plugins/git/mergetool.cpp @@ -212,6 +212,7 @@ void MergeTool::readData() m_mergeType = mergeType(m_line.left(index)); int quote = m_line.indexOf('\''); m_fileName = QString::fromLocal8Bit(m_line.mid(quote + 1, m_line.lastIndexOf('\'') - quote - 1)); + m_line.clear(); } else if (m_line.startsWith(" {local}")) { waitForFurtherInput = !hasLine; if (waitForFurtherInput) @@ -229,7 +230,11 @@ void MergeTool::readData() prompt(tr("Unchanged File"), tr("Was the merge successful?")); } else if (m_line.startsWith("Continue merging")) { prompt(tr("Continue Merging"), tr("Continue merging other unresolved paths?")); + } else if (m_line.endsWith('\n')) { + // Skip unidentified lines + m_line.clear(); } + } if (!waitForFurtherInput) m_line.clear();