diff options
author | Junio C Hamano <junkio@cox.net> | 2007-03-18 22:21:06 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-18 22:21:06 -0700 |
commit | 3635a187704ed30b32eb11f5098496e5e435a19d (patch) | |
tree | 90fbf761702cc522b5efd2fe69d02b4c797783e9 /merge-index.c | |
parent | abec100c3382f7d7b759f915a86e9773277263b6 (diff) | |
parent | 38b1c6626b4690a745e23be9aa9ada98c1a55f41 (diff) | |
download | git-3635a187704ed30b32eb11f5098496e5e435a19d.tar.gz |
Merge branch 'sp/run-command'
* sp/run-command:
Use run_command within send-pack
Use run_command within receive-pack to invoke index-pack
Use run_command within merge-index
Use run_command for proxy connections
Use RUN_GIT_CMD to run push backends
Correct new compiler warnings in builtin-revert
Replace fork_with_pipe in bundle with run_command
Teach run-command to redirect stdout to /dev/null
Teach run-command about stdout redirection
Diffstat (limited to 'merge-index.c')
-rw-r--r-- | merge-index.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/merge-index.c b/merge-index.c index 7027d78659..6df43944b0 100644 --- a/merge-index.c +++ b/merge-index.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "run-command.h" static const char *pgm; static const char *arguments[8]; @@ -7,24 +8,10 @@ static int err; static void run_program(void) { - pid_t pid = fork(); - int status; - - if (pid < 0) - die("unable to fork"); - if (!pid) { - execlp(pgm, arguments[0], - arguments[1], - arguments[2], - arguments[3], - arguments[4], - arguments[5], - arguments[6], - arguments[7], - NULL); - die("unable to execute '%s'", pgm); - } - if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) { + struct child_process child; + memset(&child, 0, sizeof(child)); + child.argv = arguments; + if (run_command(&child)) { if (one_shot) { err++; } else { |