summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2011-04-01 15:05:34 -0400
committerCode Review <codereview-daemon@eclipse.org>2011-04-01 15:05:34 -0400
commitbc42a780eb1a1b28eeb3034ff05d21a166644751 (patch)
tree296f0d7ae788ababbcb43c95cadccab7246c123b /org.eclipse.jgit
parent74419e1474b286e92dd812005fc585c3e1f21c59 (diff)
parent76d25273cc6faf134898771db60fae4b9e27f5d9 (diff)
downloadjgit-bc42a780eb1a1b28eeb3034ff05d21a166644751.tar.gz
jgit-bc42a780eb1a1b28eeb3034ff05d21a166644751.zip
Merge "Fix broken git prefix detection"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java8
2 files changed, 15 insertions, 4 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 5a48513b67..d3bfd6fce5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -286,7 +286,9 @@ public abstract class FS {
}
}
} catch (IOException e) {
- // ignore
+ if (SystemReader.getInstance().getProperty("jgit.fs.debug") != null)
+ System.err.println(e);
+ // Ignore error (but report)
}
return null;
}
@@ -295,7 +297,12 @@ public abstract class FS {
public File gitPrefix() {
Holder<File> p = gitPrefix;
if (p == null) {
- p = new Holder<File>(discoverGitPrefix());
+ String overrideGitPrefix = SystemReader.getInstance().getProperty(
+ "jgit.gitprefix");
+ if (overrideGitPrefix != null)
+ p = new Holder<File>(new File(overrideGitPrefix));
+ else
+ p = new Holder<File>(discoverGitPrefix());
gitPrefix = p;
}
return p.value;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
index b441d2066f..58f7fb4bf8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
@@ -106,8 +106,12 @@ class FS_Win32 extends FS {
String w = readPipe(userHome(), //
new String[] { "bash", "--login", "-c", "which git" }, //
Charset.defaultCharset().name());
- if (w != null)
- return new File(w).getParentFile().getParentFile();
+ if (w != null) {
+ // The path may be in cygwin/msys notation so resolve it right away
+ gitExe = resolve(null, w);
+ if (gitExe != null)
+ return gitExe.getParentFile().getParentFile();
+ }
return null;
}