Browse Source
OS X ships with a default /usr/bin/git that is just a wrapper that at run-time delegates to the selected XCode toolchain, and that prompts the user to install the XCode command line tools if not already installed. This is annoying for people who don't want to do so, since they'll be prompted on each Eclipse start. Also, since on OS X the $PATH for applications started via the GUI is not the same as the $PATH as set via the shell profile, just using /usr/bin/git (which will normally be found when JGit runs inside Eclipse) may give slightly surprising results if the user has installed a non-Apple git and changed his $PATH in the shell such that the non-Apple git is used in the shell. (For instance by placing /usr/local/bin earlier on the path.) Eclipse and the shell will use different git executables, and thus different git system configs. Therefore, try to find git via bash --login -c 'which git' not only if we couldn't find it on $PATH but also if we found the default git /usr/bin/git. If that finds some other git, use that. If the bash approach also finds /usr/bin/git, double check via xcode-select -p that an XCode git is present. If not, assume there is no git installed, and work without any system config. Bug: 564372 Change-Id: Ie9d010ebd9437a491ba5d92b4ffd1860c203f8ca Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>master
Thomas Wolf
4 years ago
2 changed files with 34 additions and 9 deletions
Loading…
Reference in new issue