aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-08-30 16:43:08 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2023-08-30 16:43:08 +0200
commit2e2e58d59f1546a791983e2b28adb99c71a93a34 (patch)
treee271bafe57718add342e23d552bdf0d710e7a807 /org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
parentabe155ea94af563110326a44d538fdb4f0af8bba (diff)
parent2be8bf2b37177256e5183f26b7ccd13e104daf5f (diff)
downloadjgit-2e2e58d59f1546a791983e2b28adb99c71a93a34.tar.gz
jgit-2e2e58d59f1546a791983e2b28adb99c71a93a34.zip
Merge branch 'master' into stable-6.7
* master: Remove the cbi-snapshots Maven repository Update Orbit to orbit-aggregation/release/4.29.0 Add target platform for Eclipse 2023-09 (4.29) Use release p2 repo for Eclipse 2023-06 (4.28) Update tycho to 4.0.2 Update jmh to 1.37 Update bouncycastle to 1.76 Fix some tests in ConfigTest Handle global git config $XDG_CONFIG_HOME/git/config IO: use JDK convenience methods org.eclipse.jgit.junit.ssh/.settings/.api_filters: fix unclosed tags ReadChangedPathFilter: fix Non-externalized string literal warning Introduce core.packedIndexGitUseStrongRefs config key DfsReader: Make PackLoadListener interface visible to subclasses DfsGarbageCollector: provide commit graph stats DfsGarbageCollector: put only GC commits into the commit graph DfsReader: Expose when indices are loaded Change-Id: Idd78a0a1bc3cd3db5edb475e235c13354d9087a9
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java12
1 files changed, 10 insertions, 2 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 991de51df7..4a48762710 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
@@ -39,6 +39,7 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectChecker;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.storage.file.FileBasedConfig;
+import org.eclipse.jgit.storage.file.UserConfigFile;
import org.eclipse.jgit.util.time.MonotonicClock;
import org.eclipse.jgit.util.time.MonotonicSystemClock;
import org.slf4j.Logger;
@@ -124,8 +125,15 @@ public abstract class SystemReader {
@Override
public FileBasedConfig openUserConfig(Config parent, FS fs) {
- return new FileBasedConfig(parent, new File(fs.userHome(), ".gitconfig"), //$NON-NLS-1$
- fs);
+ File homeFile = new File(fs.userHome(), ".gitconfig"); //$NON-NLS-1$
+ Path xdgPath = getXdgConfigDirectory(fs);
+ if (xdgPath != null) {
+ Path configPath = xdgPath.resolve("git") //$NON-NLS-1$
+ .resolve(Constants.CONFIG);
+ return new UserConfigFile(parent, homeFile, configPath.toFile(),
+ fs);
+ }
+ return new FileBasedConfig(parent, homeFile, fs);
}
@Override