diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-29 00:45:39 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-29 00:45:52 (GMT) |
commit | f120b65cd41c0e93432af1a36c82fd3a8d39ccd4 (patch) | |
tree | 0657b197543b8eedd733aac032e9587c25d0a614 /builtin | |
parent | 89bece5c8c96f0b962cfc89e63f82d603fd60bed (diff) | |
parent | ff5b7913f0af62c26682b0376d0aa2d7f5d74b2e (diff) | |
download | git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.zip git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.tar.gz git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.tar.bz2 |
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 'builtin')
-rw-r--r-- | builtin/stash.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/stash.c b/builtin/stash.c index 1ef2017..86cd0b4 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1539,8 +1539,12 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q struct child_process cp = CHILD_PROCESS_INIT; cp.git_cmd = 1; - if (startup_info->original_cwd) + if (startup_info->original_cwd) { cp.dir = startup_info->original_cwd; + strvec_pushf(&cp.env_array, "%s=%s", + GIT_WORK_TREE_ENVIRONMENT, + the_repository->worktree); + } strvec_pushl(&cp.args, "clean", "--force", "--quiet", "-d", ":/", NULL); if (include_untracked == INCLUDE_ALL_FILES) |