aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaloyan Raev <kaloyan.r@zend.com>2015-10-27 16:14:54 +0200
committerChristian Halstrick <christian.halstrick@sap.com>2015-10-29 04:35:58 -0400
commit8a53d7e2fd5b84c57c08ec3912ed61612edb7cb9 (patch)
treeea14fcc4b87303fc9727ff51841a957b26d22977
parent3afdaf0b3de90f4eec2933cd6f33e285d820984b (diff)
downloadjgit-8a53d7e2fd5b84c57c08ec3912ed61612edb7cb9.tar.gz
jgit-8a53d7e2fd5b84c57c08ec3912ed61612edb7cb9.zip
JGit CLI should check if calling itself when invoking native git exe
Bug: 480782 Change-Id: I0d7f7a648671e7ff678f2b19fe39b85f8835c061 Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
index d860d8ac72..f5cdab0f4d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -556,6 +556,14 @@ public abstract class FS {
return null;
}
+ // Bug 480782: Check if the discovered git executable is JGit CLI
+ String v = readPipe(gitExe.getParentFile(),
+ new String[] { "git", "--version" }, //$NON-NLS-1$ //$NON-NLS-2$
+ Charset.defaultCharset().name());
+ if (v.startsWith("jgit")) { //$NON-NLS-1$
+ return null;
+ }
+
// Trick Git into printing the path to the config file by using "echo"
// as the editor.
Map<String, String> env = new HashMap<>();