summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index 83f257e7fa..3fa17c98b7 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4228,8 +4228,11 @@ static int run_git_checkout(struct repository *r, struct replay_opts *opts,
cmd.git_cmd = 1;
- if (startup_info->original_cwd)
+ if (startup_info->original_cwd) {
cmd.dir = startup_info->original_cwd;
+ strvec_pushf(&cmd.env_array, "%s=%s",
+ GIT_WORK_TREE_ENVIRONMENT, r->worktree);
+ }
strvec_push(&cmd.args, "checkout");
strvec_push(&cmd.args, commit);
strvec_pushf(&cmd.env_array, GIT_REFLOG_ACTION "=%s", action);