aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-08-03 00:46:39 +0200
committerRobin Rosenberg <robin.rosenberg@dewire.com>2012-08-22 00:36:09 +0200
commitf5ef963acdd1db4f0a6cd6173ff269a01e0e697b (patch)
treeee187a27c520e42721927505d4b5b9b669e10fe2 /org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
parentef6aec3a04c8403037779e8122fa4c89af7d3d0b (diff)
downloadjgit-f5ef963acdd1db4f0a6cd6173ff269a01e0e697b.tar.gz
jgit-f5ef963acdd1db4f0a6cd6173ff269a01e0e697b.zip
Refactor detection of OS X to SystemReader
Change-Id: I34e9ba4a26f7af5b88140c070f02a7990f1941af
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java19
1 files changed, 2 insertions, 17 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
index 36d3b9484a..742afe1354 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
@@ -44,8 +44,6 @@ package org.eclipse.jgit.util;
import java.io.File;
import java.nio.charset.Charset;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -58,7 +56,7 @@ abstract class FS_POSIX extends FS {
if (gitExe != null)
return gitExe.getParentFile().getParentFile();
- if (isMacOS()) {
+ if (SystemReader.getInstance().isMacOS()) {
// On MacOSX, PATH is shorter when Eclipse is launched from the
// Finder than from a terminal. Therefore try to launch bash as a
// login shell and search using that.
@@ -87,10 +85,7 @@ abstract class FS_POSIX extends FS {
@Override
public boolean isCaseSensitive() {
- if (isMacOS())
- return false;
- else
- return true;
+ return !SystemReader.getInstance().isMacOS();
}
@Override
@@ -105,14 +100,4 @@ abstract class FS_POSIX extends FS {
proc.command(argv);
return proc;
}
-
- private static boolean isMacOS() {
- final String osDotName = AccessController
- .doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty("os.name");
- }
- });
- return "Mac OS X".equals(osDotName) || "Darwin".equals(osDotName);
- }
}