Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2019-03-19 22:03:07 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-19 11:32:10 +0300
commitfc4a6735ee10b7699c22dfb58a9dd40f225e51bd (patch)
treee060b60e440328840d2899c7c16cabf7e10d6789 /builtin/rebase--interactive.c
parent464c824a9b3daf49b1451746780c787279cbf79f (diff)
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>
Diffstat (limited to 'builtin/rebase--interactive.c')
-rw-r--r--builtin/rebase--interactive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rebase--interactive.c b/builtin/rebase--interactive.c
index 4535523bf5..d1a4ac1b84 100644
--- a/builtin/rebase--interactive.c
+++ b/builtin/rebase--interactive.c
@@ -171,7 +171,7 @@ static int do_interactive_rebase(struct replay_opts *opts, unsigned flags,
struct argv_array make_script_args = ARGV_ARRAY_INIT;
struct todo_list todo_list = TODO_LIST_INIT;
- if (prepare_branch_to_be_rebased(opts, switch_to))
+ if (prepare_branch_to_be_rebased(the_repository, opts, switch_to))
return -1;
if (get_revision_ranges(upstream, onto, &head_hash,