Modify setup_path() to only add git_exec_path() to PATH
commit332870ef8c944f882c2bfecfabc2c1d7816b61de
authorSteffen Prohaska <prohaska@zib.de>
Sun, 17 Aug 2008 09:30:33 +0000 (17 11:30 +0200)
committerSteffen Prohaska <prohaska@zib.de>
Thu, 25 Dec 2008 12:32:32 +0000 (25 13:32 +0100)
treef0c02a8de6414fbe6b2f7d262e2c99463fee39fb
parenta0489201ee44060dbb680721ee8d84477b1784f4
Modify setup_path() to only add git_exec_path() to PATH

Searching git programs only in the highest priority location is
sufficient.  It does not make sense that some of the required
programs are located at the highest priority location but other
programs are picked up from a lower priority exec-path.  If
exec-path is overridden a complete set of commands should be
provided, otherwise several different versions could get mixed,
which is likely to cause confusion.

If a user explicitly overrides the default location (by --exec-path
or GIT_EXEC_PATH), we now expect that that all the required
programs are found there.  Instead of adding the directories
"argv_exec_path", "getenv(EXEC_PATH_ENVIRONMENT)", and
"system_path(GIT_EXEC_PATH)" to PATH, we now rely on
git_exec_path(), which implements the same order, but only returns
the highest priority location to search for executables.

Accessing only the location with highest priority is also required
for testing executables built with RUNTIME_PREFIX.  The call to
system_path() should be avoided if RUNTIME_PREFIX is set and the
executable is not installed at its final destination.  Because we
test before installing, we want to avoid calling system_path()
during tests.  The modifications brought by this commit avoid
calling system_path(GIT_EXEC_PATH) if a higher-priority location is
provided, which is the case when running the tests.
exec_cmd.c