Browse Source

Make FS OS X detection work for OpenJDK

OpenJDK sets the os.name system.property to "Darwin", while Apple's
version says "Mac OS X".

Change-Id: If08f8e7b8ef94ec00023a3f78bbf502ebd9699fb
stable-2.0
Robin Rosenberg 13 years ago
parent
commit
20c33e6b0c
  1. 7
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java

7
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java vendored

@ -1015,10 +1015,9 @@ public class DirCacheCheckout {
} }
private static boolean isValidPathSegment(CanonicalTreeParser t) { private static boolean isValidPathSegment(CanonicalTreeParser t) {
boolean isWindows = "Windows".equals(SystemReader.getInstance() String osName = SystemReader.getInstance().getProperty("os.name");
.getProperty("os.name")); boolean isWindows = "Windows".equals(osName);
boolean isOSX = "Mac OS X".equals(SystemReader.getInstance() boolean isOSX = "Darwin".equals(osName) || "Mac OS X".equals(osName);
.getProperty("os.name"));
boolean ignCase = isOSX || isWindows; boolean ignCase = isOSX || isWindows;
int ptr = t.getNameOffset(); int ptr = t.getNameOffset();

2
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java

@ -105,6 +105,6 @@ abstract class FS_POSIX extends FS {
return System.getProperty("os.name"); return System.getProperty("os.name");
} }
}); });
return "Mac OS X".equals(osDotName); return "Mac OS X".equals(osDotName) || "Darwin".equals(osDotName);
} }
} }

Loading…
Cancel
Save