Do not resolve path using cygwin unless told to

The system property jgit.cygpath must be set to true in order
for cygwin's cygpath to be used to translate path from cygwin
namespace to Windows namespace.

The cygwin path translation should be considered deprecated.

Bug: 353389
Change-Id: I2b5234c0ab936dac67d1e232f4cd28331bf3226d
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
This commit is contained in:
Robin Rosenberg 2011-10-28 14:58:32 +02:00 committed by SystemConfig
parent b6281cac01
commit 3ceb4fac23
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);
}