]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
sequencer: always discard index after checkout
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 19 Mar 2019 19:03:07 +0000 (19:03 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Apr 2019 08:32:10 +0000 (17:32 +0900)
commitfc4a6735ee10b7699c22dfb58a9dd40f225e51bd
treee060b60e440328840d2899c7c16cabf7e10d6789
parent464c824a9b3daf49b1451746780c787279cbf79f
sequencer: always discard index after checkout

As the checkout runs in a separate process our index will be out of date
so it should be discarded. The existing callers are not doing this
consistently so do it here to avoid the callers having to worry about
it.

This fixes some test failures that happen if do_interactive_rebase() is
called without forking rebase--interactive which we will implement
shortly. Running

  git rebase -i master topic

starting on master created empty todo lists because all the commits in
topic were marked as cherry-picks. After topic was checked out in
prepare_branch_to_be_rebased() the working tree contained the contents
from topic but the index contained master and the cache entries were
still valid. This meant that diff_populate_filespec() which loads the
blobs when calculating patch-id's ended up reading the contents for
master from the working tree which actually contained topic.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase--interactive.c
sequencer.c
sequencer.h