Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
index dd7f19081..1d38288bc 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
@@ -183,6 +183,7 @@ public class PatchReader {
String diffArgs= null;
String fileName= null;
List headerLines = new ArrayList();
+ boolean foundDiff= false;
// read leading garbage
reread= line!=null;
@@ -197,8 +198,9 @@ public class PatchReader {
if (line.startsWith("Index: ")) { //$NON-NLS-1$
fileName= line.substring(7).trim();
} else if (line.startsWith("diff")) { //$NON-NLS-1$
- if (!this.fIsGitPatch && GIT_PATCH_PATTERN.matcher(line).matches())
+ if (!foundDiff && GIT_PATCH_PATTERN.matcher(line).matches())
this.fIsGitPatch= true;
+ foundDiff= true;
diffArgs= line.substring(4).trim();
} else if (line.startsWith("--- ")) { //$NON-NLS-1$
line= readUnifiedDiff(diffs, lr, line, diffArgs, fileName);

Back to the top