From 511707d42b3b3e57d9623493092590546ffeae80 Mon Sep 17 00:00:00 2001 From: Scott R Parish Date: Sun, 28 Oct 2007 04:17:20 -0700 Subject: use only the $PATH for exec'ing git commands We need to correctly set up $PATH for non-c based git commands. Since we already do this, we can just use that $PATH and execvp, instead of looping over the paths with execve. This patch adds a setup_path() function to exec_cmd.c, which sets the $PATH order correctly for our search order. execv_git_cmd() is stripped down to setting up argv and calling execvp(). git.c's main() only only needs to call setup_path(). Signed-off-by: Scott R Parish Signed-off-by: Junio C Hamano --- exec_cmd.h | 1 + 1 file changed, 1 insertion(+) (limited to 'exec_cmd.h') diff --git a/exec_cmd.h b/exec_cmd.h index da99287552..a892355c82 100644 --- a/exec_cmd.h +++ b/exec_cmd.h @@ -3,6 +3,7 @@ extern void git_set_argv_exec_path(const char *exec_path); extern const char* git_exec_path(void); +extern void setup_path(const char *); extern int execv_git_cmd(const char **argv); /* NULL terminated */ extern int execl_git_cmd(const char *cmd, ...); -- cgit v1.3