Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2012-03-14 12:27:04 -0400
committerDani Megert2012-03-14 12:27:04 -0400
commit1607e13426ba2abc67ae4017efab88bcb93d9733 (patch)
treeff9b964641d6e2b35739e423ea15476ba332ac22
parentfe187c8582c4970fecd148d4e3371bdab786e80b (diff)
downloadeclipse.platform.team-1607e13426ba2abc67ae4017efab88bcb93d9733.tar.gz
eclipse.platform.team-1607e13426ba2abc67ae4017efab88bcb93d9733.tar.xz
eclipse.platform.team-1607e13426ba2abc67ae4017efab88bcb93d9733.zip
Additional fix for bug 358527: Applying a Git patch needs too much userv20120314-1627I20120328-2028I20120328-2020I20120328-2007I20120328-1956
work
-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