diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-01-12 14:58:55 +0100 |
---|---|---|
committer | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-01-12 14:58:55 +0100 |
commit | 0fd9676771573be210dd0267172afcdc0f4e04c6 (patch) | |
tree | 5f61b668280acaa69a2f74469fa108e782fc821a /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | be38185a033021da707f934caf96b68070050bd5 (diff) | |
download | jgit-0fd9676771573be210dd0267172afcdc0f4e04c6.tar.gz jgit-0fd9676771573be210dd0267172afcdc0f4e04c6.zip |
Locate $HOME like C Git does on Windows
Java's user.home is not the same as $HOME so EGit did see the
same global configuration as C Git does.
Bug: 333269
Change-Id: Id54fc5292bf8c5a67177f9097ee692717a7df336
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java index 2cf8bf9554..0ee7a6bc50 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java @@ -96,4 +96,22 @@ class FS_Win32 extends FS { return null; } + + @Override + protected File userHomeImpl() { + String home = SystemReader.getInstance().getenv("HOME"); + if (home != null) + return resolve(null, home); + String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE"); + if (homeDrive != null) { + String homePath = SystemReader.getInstance().getenv("HOMEPATH"); + return new File(homeDrive, homePath); + } + + String homeShare = SystemReader.getInstance().getenv("HOMESHARE"); + if (homeShare != null) + return new File(homeShare); + + return super.userHomeImpl(); + } } |