summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-12-09 05:08:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-12-09 21:33:13 (GMT)
commitbc3ae46b420f58dfe2bfd87714dca096a043d554 (patch)
treefcdead9833944f8fecae5e2a3c2cd1271c7c0732 /sequencer.c
parentc65744e7d7f512f3666da5964f0ace90325dd94a (diff)
downloadgit-bc3ae46b420f58dfe2bfd87714dca096a043d554.zip
git-bc3ae46b420f58dfe2bfd87714dca096a043d554.tar.gz
git-bc3ae46b420f58dfe2bfd87714dca096a043d554.tar.bz2
rebase: do not attempt to remove startup_info->original_cwd
Since rebase spawns a `checkout` subprocess, make sure we run that from the startup_info->original_cwd directory, so that the checkout process knows to protect that directory. Acked-by: Derrick Stolee <stolee@gmail.com> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index ea96837..83f257e 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4228,6 +4228,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);