diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2019-03-19 19:03:07 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-19 17:32:10 +0900 |
commit | fc4a6735ee10b7699c22dfb58a9dd40f225e51bd (patch) | |
tree | e060b60e440328840d2899c7c16cabf7e10d6789 /sequencer.h | |
parent | Merge branch 'ag/sequencer-reduce-rewriting-todo' into pw/rebase-i-internal (diff) | |
download | tgif-fc4a6735ee10b7699c22dfb58a9dd40f225e51bd.tar.xz |
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 'sequencer.h')
-rw-r--r-- | sequencer.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sequencer.h b/sequencer.h index a515ee4457..6c55aa4200 100644 --- a/sequencer.h +++ b/sequencer.h @@ -175,7 +175,8 @@ void commit_post_rewrite(struct repository *r, const struct commit *current_head, const struct object_id *new_head); -int prepare_branch_to_be_rebased(struct replay_opts *opts, const char *commit); +int prepare_branch_to_be_rebased(struct repository *r, struct replay_opts *opts, + const char *commit); #define SUMMARY_INITIAL_COMMIT (1 << 0) #define SUMMARY_SHOW_AUTHOR_DATE (1 << 1) |