]> source.dussan.org Git - jgit.git/commitdiff
Do not resolve path using cygwin unless told to 31/4431/1
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Fri, 28 Oct 2011 12:58:32 +0000 (14:58 +0200)
committerSystemConfig <robin.rosenberg@dewire.com>
Fri, 28 Oct 2011 12:58:32 +0000 (14:58 +0200)
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>
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java

index e5e97c5fb952c0443b61f5e76b4bb571fe7f1efb..ee83c65f8b29e7e400d7f77462c211ae5f54178f 100644 (file)
@@ -81,11 +81,14 @@ class FS_Win32_Cygwin extends FS_Win32 {
        }
 
        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);
        }