Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-02-28 13:28:14 +0000
committerDani Megert2013-02-28 13:29:21 +0000
commit422a25a5f2b3c3c5189690e2318c8b12b239bc3d (patch)
treeffa7747c46f174f6dec8710b00c613af0d4cb0f6
parent57c9a3c07c972dd980fa8b106c4b1b94156f9651 (diff)
downloadeclipse.platform.team-422a25a5f2b3c3c5189690e2318c8b12b239bc3d.tar.gz
eclipse.platform.team-422a25a5f2b3c3c5189690e2318c8b12b239bc3d.tar.xz
eclipse.platform.team-422a25a5f2b3c3c5189690e2318c8b12b239bc3d.zip
Ignore Git version numberv20130228-132921
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java8
1 files changed, 6 insertions, 2 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 b625d21bb..0e22b4166 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -67,6 +67,9 @@ public class PatchReader {
private static final Pattern GIT_PATCH_PATTERN= Pattern.compile("^diff --git a/.+ b/.+[\r\n]+$"); //$NON-NLS-1$
+ private static final Pattern GIT_VERSION_PATTERN= Pattern.compile("^\\d+\\.\\d*.*$"); //$NON-NLS-1$
+
+
/**
* Create a patch reader for the default date formats.
*/
@@ -338,7 +341,8 @@ public class PatchReader {
break;
//$FALL-THROUGH$
default:
- throw new IOException("Invalid patch"); //$NON-NLS-1$
+ if (!isGitPatch() || !GIT_VERSION_PATTERN.matcher(line.trim()).matches())
+ throw new IOException("Invalid patch"); //$NON-NLS-1$
}
return line;
}

Back to the top