threads / patch / 12449

patchreceive-pack: Initialize PATH to include exec-dir.

Subject: [PATCH] receive-pack: Initialize PATH to include exec-dir.

## tl;dr

3 messages between Mar 3, 2008 and Mar 3, 2008. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Björn Steinbrink· Mar 3, 2008, 04:08 UTC · lore

511707d (use only the $PATH for exec'ing git commands) made it a requirement to call setup_path() to include the git exec-dir in PATH before spawning any other git commands. git-receive-pack was not yet adapted to do this and therefore fails to spawn git-unpack-objects if that is not in the standard PATH.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
 receive-pack.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Show changes to receive-pack.c +2 −0
diff --git a/receive-pack.c b/receive-pack.c
index a971433..f83ae87 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -471,6 +471,8 @@ int main(int argc, char **argv)
 	if (!dir)
 		usage(receive_pack_usage);
 
+	setup_path(NULL);
+
 	if (!enter_repo(dir, 0))
 		die("'%s': unable to chdir or not a git archive", dir);
 
-- 
1.5.4.3.1.g3b5b4
Bernt Hansen· Mar 3, 2008, 04:21 UTC · re: Björn Steinbrink · lore

Re: [PATCH] receive-pack: Initialize PATH to include exec-dir.

Björn Steinbrink <B.Steinbrink@gmx.de> writes:
Show 30 quoted lines
> 511707d (use only the $PATH for exec'ing git commands) made it a
> requirement to call setup_path() to include the git exec-dir in PATH
> before spawning any other git commands. git-receive-pack was not yet
> adapted to do this and therefore fails to spawn git-unpack-objects if that
> is not in the standard PATH.
>
> Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
> ---
>  receive-pack.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/receive-pack.c b/receive-pack.c
> index a971433..f83ae87 100644
> --- a/receive-pack.c
> +++ b/receive-pack.c
> @@ -471,6 +471,8 @@ int main(int argc, char **argv)
>  	if (!dir)
>  		usage(receive_pack_usage);
>  
> +	setup_path(NULL);
> +
>  	if (!enter_repo(dir, 0))
>  		die("'%s': unable to chdir or not a git archive", dir);
>  
> -- 
> 1.5.4.3.1.g3b5b4
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tested by: Bernt Hansen <bernt@norang.ca>

← back to recent threads