summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-01-27 06:22:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-01-27 06:22:24 (GMT)
commitb23dac905bde28da47543484320db16312c87551 (patch)
tree8d15d93247a153e3e58da7530285679d46420ec0 /sequencer.c
parent7747e12d7147480aa32d2ab9b92ff90016226149 (diff)
parentff5b7913f0af62c26682b0376d0aa2d7f5d74b2e (diff)
downloadgit-b23dac905bde28da47543484320db16312c87551.zip
git-b23dac905bde28da47543484320db16312c87551.tar.gz
git-b23dac905bde28da47543484320db16312c87551.tar.bz2
Merge branch 'en/keep-cwd'
Fix a regression in 2.35 that roke the use of "rebase" and "stash" in a secondary worktree. * en/keep-cwd: sequencer, stash: fix running from worktree subdir
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 6abd721..5213d16 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4223,8 +4223,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);