path: root/exec_cmd.h
diff options
authorScott R Parish <>2007-10-28 11:17:20 (GMT)
committerJunio C Hamano <>2007-10-30 03:51:37 (GMT)
commit511707d42b3b3e57d9623493092590546ffeae80 (patch)
tree7d37f2f06ad9f66c0595526332d7f8ac19a9c67e /exec_cmd.h
parent0966003c8e8d1528912b10667b903cd981e3a7f6 (diff)
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 <>
Diffstat (limited to 'exec_cmd.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/exec_cmd.h b/exec_cmd.h
index da99287..a892355 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, ...);