Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2012-03-14 12:06:39 -0400
committerDani Megert2012-03-14 12:06:39 -0400
commitfe187c8582c4970fecd148d4e3371bdab786e80b (patch)
tree4909bbe8f2eb1f12a1ed8244b52dca31f254977c
parent78b06e932f107395de4ac4bad9a6113a78639766 (diff)
downloadeclipse.platform.team-fe187c8582c4970fecd148d4e3371bdab786e80b.tar.gz
eclipse.platform.team-fe187c8582c4970fecd148d4e3371bdab786e80b.tar.xz
eclipse.platform.team-fe187c8582c4970fecd148d4e3371bdab786e80b.zip
Additional fix for bug 358527: Applying a Git patch needs too much user
work
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java11
1 files changed, 6 insertions, 5 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 983b7f6b7..dd7f19081 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
@@ -22,14 +22,15 @@ import java.util.Locale;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
-import org.eclipse.compare.patch.IFilePatch2;
+import com.ibm.icu.text.DateFormat;
+import com.ibm.icu.text.SimpleDateFormat;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
+import org.eclipse.compare.patch.IFilePatch2;
public class PatchReader {
@@ -107,8 +108,6 @@ public class PatchReader {
if (line != null && line.startsWith(PatchReader.MULTIPROJECTPATCH_HEADER)) {
this.fIsWorkspacePatch= true;
} else {
- if (line != null && GIT_PATCH_PATTERN.matcher(line).matches())
- this.fIsGitPatch = true;
parse(lr, line);
return;
}
@@ -198,6 +197,8 @@ 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())
+ this.fIsGitPatch= true;
diffArgs= line.substring(4).trim();
} else if (line.startsWith("--- ")) { //$NON-NLS-1$
line= readUnifiedDiff(diffs, lr, line, diffArgs, fileName);

Back to the top