diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-29 01:45:39 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-29 01:45:52 +0100 |
commit | f120b65cd41c0e93432af1a36c82fd3a8d39ccd4 (patch) | |
tree | 0657b197543b8eedd733aac032e9587c25d0a614 /sequencer.c | |
parent | Git 2.35 (diff) | |
parent | sequencer, stash: fix running from worktree subdir (diff) | |
download | git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.tar.xz git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.zip |
Merge branch 'en/keep-cwd' into maint
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c index 6abd72160c..5213d16e97 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); |