Windows: start_command: Support non-NULL dir in struct child_process
[gitweb.git] / run-command.c
index 2feb493951322617692085998ac8507cdba9dd30..db30cd5fe29b9d9af11860da316ac1f45e290593 100644 (file)
@@ -335,8 +335,6 @@ int start_command(struct child_process *cmd)
        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 @@ int start_command(struct child_process *cmd)
                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))