[PATCH] upload-pack: Initialize the exec-path.
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Feb 12, 2008, 11:28 UTC
- Message-ID
- <47B182C1.60006@viscovery.net>
- In-Reply-To
- <alpine.LSU.1.00.0802121028290.3870@racer.site>
From: Johannes Sixt <johannes.sixt@telecom.at>
Since git-upload-pack has to spawn git-pack-objects, it has to make sure that the latter can be found in the PATH. Without this patch an attempt to clone or pull via ssh from a server fails if the git tools are not in the standard PATH on the server even though git clone or git pull were invoked with --upload-pack=/path/to/git-upload-pack.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> --- Johannes Schindelin schrieb:
Show 9 quoted lines
> Hi, > > On Tue, 12 Feb 2008, Johannes Sixt wrote: >> The problem is that git-upload-pack (which is not a built-in) does not >> call setup_path() and so does not extend PATH to contain the special >> installation location. Now, when git-upload-pack tries to exec >> git-pack-objects, it fails since this is not in PATH. > > So, let's make git-upload-pack a builtin, no?
How about this (almost) one-liner instead?
-- Hannes
upload-pack.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c index 7e04311..51e3ec4 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -620,6 +620,9 @@ int main(int argc, char **argv) if (i != argc-1) usage(upload_pack_usage); + + setup_path(NULL); + dir = argv[i]; if (!enter_repo(dir, strict))
-- 1.5.4.rc3.24.g25a9a