]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.c
Merge branch 'js/t1450-making-it-writable-does-not-need-full-posixperm'
[thirdparty/git.git] / sequencer.c
index b69ef4dd4e3b8b35695b7cd04a07fd102a7d6beb..6abd72160ccd46791d5a262021804e07ab9ea37f 100644 (file)
@@ -3497,17 +3497,12 @@ static int error_failed_squash(struct repository *r,
 
 static int do_exec(struct repository *r, const char *command_line)
 {
-       struct strvec child_env = STRVEC_INIT;
        const char *child_argv[] = { NULL, NULL };
        int dirty, status;
 
        fprintf(stderr, _("Executing: %s\n"), command_line);
        child_argv[0] = command_line;
-       strvec_pushf(&child_env, "GIT_DIR=%s", absolute_path(get_git_dir()));
-       strvec_pushf(&child_env, "GIT_WORK_TREE=%s",
-                    absolute_path(get_git_work_tree()));
-       status = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,
-                                         child_env.v);
+       status = run_command_v_opt(child_argv, RUN_USING_SHELL);
 
        /* force re-reading of the cache */
        if (discard_index(r->index) < 0 || repo_read_index(r) < 0)
@@ -3537,8 +3532,6 @@ static int do_exec(struct repository *r, const char *command_line)
                status = 1;
        }
 
-       strvec_clear(&child_env);
-
        return status;
 }
 
@@ -4230,6 +4223,8 @@ static int run_git_checkout(struct repository *r, struct replay_opts *opts,
 
        cmd.git_cmd = 1;
 
+       if (startup_info->original_cwd)
+               cmd.dir = startup_info->original_cwd;
        strvec_push(&cmd.args, "checkout");
        strvec_push(&cmd.args, commit);
        strvec_pushf(&cmd.env_array, GIT_REFLOG_ACTION "=%s", action);