run-command (Windows): Run dashless "git <cmd>"
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>
This commit is contained in:

committed by
Junio C Hamano

parent
4933e5ebde
commit
108ac313f7
@ -119,9 +119,8 @@ int start_command(struct child_process *cmd)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int s0 = -1, s1 = -1, s2 = -1; /* backups of stdin, stdout, stderr */
|
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;
|
char **env = environ;
|
||||||
struct strbuf git_cmd;
|
|
||||||
|
|
||||||
if (cmd->no_stdin) {
|
if (cmd->no_stdin) {
|
||||||
s0 = dup(0);
|
s0 = dup(0);
|
||||||
@ -165,9 +164,7 @@ int start_command(struct child_process *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cmd->git_cmd) {
|
if (cmd->git_cmd) {
|
||||||
strbuf_init(&git_cmd, 0);
|
cmd->argv = prepare_git_cmd(cmd->argv);
|
||||||
strbuf_addf(&git_cmd, "git-%s", cmd->argv[0]);
|
|
||||||
cmd->argv[0] = git_cmd.buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env);
|
cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env);
|
||||||
@ -175,9 +172,9 @@ int start_command(struct child_process *cmd)
|
|||||||
if (cmd->env)
|
if (cmd->env)
|
||||||
free_environ(env);
|
free_environ(env);
|
||||||
if (cmd->git_cmd)
|
if (cmd->git_cmd)
|
||||||
strbuf_release(&git_cmd);
|
free(cmd->argv);
|
||||||
|
|
||||||
cmd->argv[0] = sargv0;
|
cmd->argv = sargv;
|
||||||
if (s0 >= 0)
|
if (s0 >= 0)
|
||||||
dup2(s0, 0), close(s0);
|
dup2(s0, 0), close(s0);
|
||||||
if (s1 >= 0)
|
if (s1 >= 0)
|
||||||
|
Reference in New Issue
Block a user