apply.c: make init_apply_state() take a struct repository
We're moving away from the_index in this code. "struct index_state *" could be added to struct apply_state. But let's aim long term and put struct repository here instead so that we could even avoid more global states in the future. The index will be available via apply_state->repo->index. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
332a82a522
commit
82ea77eca7
@ -1464,7 +1464,7 @@ static int run_apply(const struct am_state *state, const char *index_file)
|
||||
int force_apply = 0;
|
||||
int options = 0;
|
||||
|
||||
if (init_apply_state(&apply_state, NULL))
|
||||
if (init_apply_state(&apply_state, the_repository, NULL))
|
||||
BUG("init_apply_state() failed");
|
||||
|
||||
argv_array_push(&apply_opts, "apply");
|
||||
|
@ -16,7 +16,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
|
||||
int ret;
|
||||
struct apply_state state;
|
||||
|
||||
if (init_apply_state(&state, prefix))
|
||||
if (init_apply_state(&state, the_repository, prefix))
|
||||
exit(128);
|
||||
|
||||
argc = apply_parse_options(argc, argv,
|
||||
|
Reference in New Issue
Block a user