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
tags/v2.0.0.201206130900-r
Robin Rosenberg 12 years ago
parent
commit
20c33e6b0c

+ 3
- 4
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java View File

@@ -1015,10 +1015,9 @@ public class DirCacheCheckout {
}

private static boolean isValidPathSegment(CanonicalTreeParser t) {
boolean isWindows = "Windows".equals(SystemReader.getInstance()
.getProperty("os.name"));
boolean isOSX = "Mac OS X".equals(SystemReader.getInstance()
.getProperty("os.name"));
String osName = SystemReader.getInstance().getProperty("os.name");
boolean isWindows = "Windows".equals(osName);
boolean isOSX = "Darwin".equals(osName) || "Mac OS X".equals(osName);
boolean ignCase = isOSX || isWindows;

int ptr = t.getNameOffset();

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java View File

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

Loading…
Cancel
Save