From: Johannes Sixt Date: Wed, 18 Mar 2009 07:42:53 GMT Subject: Re: --exec-path not always honored Message-ID: <49C0A5FD.70004@viscovery.net> In-Reply-To: <7v7i2nmlpt.fsf@gitster.siamese.dyndns.org> Junio C Hamano schrieb: > Johannes Sixt writes: > >> git-gc is a builtin. Should git setenv("GIT_EXEC_PATH") before it runs >> other git commands? > > I think we just never have bothered about such a use case, but you are > right. It probably is a good solution, although setenv makes me feel a > bit nervous for no rational reason. This patch fixes the use case and is IMO the most logical solution. diff --git a/exec_cmd.c b/exec_cmd.c index 217c125..408e4e5 100644 --- a/exec_cmd.c +++ b/exec_cmd.c @@ -61,6 +61,10 @@ const char *git_extract_argv0_path(const char *argv0) void git_set_argv_exec_path(const char *exec_path) { argv_exec_path = exec_path; + /* + * Propagate this setting to external programs. + */ + setenv(EXEC_PATH_ENVIRONMENT, exec_path, 1); }