aboutsummaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2010-04-11 22:40:12 +0200
committerJunio C Hamano <gitster@pobox.com>2010-04-11 13:48:46 -0700
commitf9a2743c3529baab6de650aa3e3eb96de9386fec (patch)
treec639acad982fb1fb3fa1f80915b6944361421a46 /run-command.c
parenteee49b6ce4b7b3fed28794676c67ad3609f658ac (diff)
downloadgit-f9a2743c3529baab6de650aa3e3eb96de9386fec.tar.gz
git-f9a2743c3529baab6de650aa3e3eb96de9386fec.tar.xz
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c4
1 files changed, 1 insertions, 3 deletions
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))