Equalize discoverGitPrefix() implementations between POSIX and Win32
Change-Id: I936df151890d4bba9079d79c65b75a69c209523b Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
This commit is contained in:
parent
8025443db4
commit
4ca2fc5ce7
|
@ -141,16 +141,18 @@ protected File discoverGitPrefix() {
|
||||||
return resolveGrandparentFile(gitExe);
|
return resolveGrandparentFile(gitExe);
|
||||||
|
|
||||||
if (SystemReader.getInstance().isMacOS()) {
|
if (SystemReader.getInstance().isMacOS()) {
|
||||||
// On MacOSX, PATH is shorter when Eclipse is launched from the
|
if (searchPath(path, "bash") != null) { //$NON-NLS-1$
|
||||||
// Finder than from a terminal. Therefore try to launch bash as a
|
// On MacOSX, PATH is shorter when Eclipse is launched from the
|
||||||
// login shell and search using that.
|
// Finder than from a terminal. Therefore try to launch bash as a
|
||||||
//
|
// login shell and search using that.
|
||||||
String w = readPipe(userHome(), //
|
String w = readPipe(userHome(),
|
||||||
new String[] { "bash", "--login", "-c", "which git" }, // //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
new String[] { "bash", "--login", "-c", "which git" }, // //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||||
Charset.defaultCharset().name());
|
Charset.defaultCharset().name());
|
||||||
if (w == null || w.length() == 0)
|
if (w == null || w.length() == 0)
|
||||||
return null;
|
return null;
|
||||||
return resolveGrandparentFile(new File(w));
|
gitExe = new File(w);
|
||||||
|
return resolveGrandparentFile(gitExe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -117,12 +117,12 @@ protected File discoverGitPrefix() {
|
||||||
String w = readPipe(userHome(),
|
String w = readPipe(userHome(),
|
||||||
new String[] { "bash", "--login", "-c", "which git" }, // //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
new String[] { "bash", "--login", "-c", "which git" }, // //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||||
Charset.defaultCharset().name());
|
Charset.defaultCharset().name());
|
||||||
if (w != null) {
|
if (w == null || w.length() == 0)
|
||||||
// The path may be in cygwin/msys notation so resolve it right away
|
return null;
|
||||||
gitExe = resolve(null, w);
|
// The path may be in cygwin/msys notation so resolve it right away
|
||||||
if (gitExe != null)
|
gitExe = resolve(null, w);
|
||||||
return resolveGrandparentFile(gitExe);
|
if (gitExe != null)
|
||||||
}
|
return resolveGrandparentFile(gitExe);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue