summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4933e5e)
raw | patch | inline | side by side (parent: 4933e5e)
author | Steffen Prohaska <prohaska@zib.de> | |
Mon, 28 Jul 2008 05:50:28 +0000 (07:50 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 29 Jul 2008 06:02:11 +0000 (23:02 -0700) |
We prefer running the dashless form, and POSIX side already does so; we
should use it in MinGW's start_command(), too.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
should use it in MinGW's start_command(), too.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c | patch | blob | history |
diff --git a/run-command.c b/run-command.c
index 6e29fdf9e2968900d21ea48b992f292204621f19..a3b28a64dc2d1b888b0ba2a135be10fe04651201 100644 (file)
--- a/run-command.c
+++ b/run-command.c
}
#else
int s0 = -1, s1 = -1, s2 = -1; /* backups of stdin, stdout, stderr */
- const char *sargv0 = cmd->argv[0];
+ const char **sargv = cmd->argv;
char **env = environ;
- struct strbuf git_cmd;
if (cmd->no_stdin) {
s0 = dup(0);
}
if (cmd->git_cmd) {
- strbuf_init(&git_cmd, 0);
- strbuf_addf(&git_cmd, "git-%s", cmd->argv[0]);
- cmd->argv[0] = git_cmd.buf;
+ cmd->argv = prepare_git_cmd(cmd->argv);
}
cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env);
if (cmd->env)
free_environ(env);
if (cmd->git_cmd)
- strbuf_release(&git_cmd);
+ free(cmd->argv);
- cmd->argv[0] = sargv0;
+ cmd->argv = sargv;
if (s0 >= 0)
dup2(s0, 0), close(s0);
if (s1 >= 0)