aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorSimeon Andreev <simeon.danailov.andreev@gmail.com>2022-06-17 12:19:50 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2022-06-17 14:39:48 +0200
commit0c32889ebcc61845765514fee56d6641bd91b542 (patch)
treeb93b38e173544dbadc411386c5a1128ce9f01988 /org.eclipse.jgit/src
parent2adbd743879762389b41713d527066fab0151163 (diff)
downloadjgit-0c32889ebcc61845765514fee56d6641bd91b542.tar.gz
jgit-0c32889ebcc61845765514fee56d6641bd91b542.zip
Run tests that checks araxis output only on Linux
Bug: 580189 Change-Id: Ieb14f5cf061fcb468b602c7f27e27b672e3b09e2 Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
index 16e2577911..5ced0713e0 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
@@ -63,6 +63,8 @@ public abstract class SystemReader {
private static volatile Boolean isWindows;
+ private static volatile Boolean isLinux;
+
static {
SystemReader r = new Default();
r.init();
@@ -185,6 +187,7 @@ public abstract class SystemReader {
public static void setInstance(SystemReader newReader) {
isMacOS = null;
isWindows = null;
+ isLinux = null;
if (newReader == null)
INSTANCE = DEFAULT;
else {
@@ -543,6 +546,20 @@ public abstract class SystemReader {
return isMacOS.booleanValue();
}
+ /**
+ * Whether we are running on Linux.
+ *
+ * @return true if we are running on Linux.
+ * @since 6.3
+ */
+ public boolean isLinux() {
+ if (isLinux == null) {
+ String osname = getOsName();
+ isLinux = Boolean.valueOf(osname.toLowerCase().startsWith("linux")); //$NON-NLS-1$
+ }
+ return isLinux.booleanValue();
+ }
+
private String getOsName() {
return AccessController.doPrivileged(
(PrivilegedAction<String>) () -> getProperty("os.name") //$NON-NLS-1$