Merge "Do not resolve path using cygwin unless told to"

This commit is contained in:
Shawn Pearce 2011-11-04 18:09:56 -04:00 committed by Code Review
commit 00235c77d6
1 changed files with 8 additions and 5 deletions

View File

@ -81,11 +81,14 @@ public FS newInstance() {
}
public File resolve(final File dir, final String pn) {
String w = readPipe(dir, //
new String[] { cygpath, "--windows", "--absolute", pn }, //
"UTF-8");
if (w != null)
return new File(w);
String useCygPath = System.getProperty("jgit.usecygpath");
if (useCygPath != null && useCygPath.equals("true")) {
String w = readPipe(dir, //
new String[] { cygpath, "--windows", "--absolute", pn }, //
"UTF-8");
if (w != null)
return new File(w);
}
return super.resolve(dir, pn);
}