From f9a2743c3529baab6de650aa3e3eb96de9386fec Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 11 Apr 2010 22:40:12 +0200 Subject: Windows: start_command: Support non-NULL dir in struct child_process A caller of start_command can set the member 'dir' to a directory to request that the child process starts with that directory as CWD. The first user of this feature was added recently in eee49b6 (Teach diff --submodule and status to handle .git files in submodules). On Windows, we have been lazy and had not implemented support for this feature, yet. This fixes the shortcoming. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- run-command.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'run-command.c') diff --git a/run-command.c b/run-command.c index 2feb49395..db30cd5fe 100644 --- a/run-command.c +++ b/run-command.c @@ -335,8 +335,6 @@ fail_pipe: else if (cmd->out > 1) fhout = dup(cmd->out); - if (cmd->dir) - die("chdir in start_command() not implemented"); if (cmd->env) env = make_augmented_environ(cmd->env); @@ -346,7 +344,7 @@ fail_pipe: cmd->argv = prepare_shell_cmd(cmd->argv); } - cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env, + cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env, cmd->dir, fhin, fhout, fherr); failed_errno = errno; if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT)) -- cgit v1.2.1