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
2
apply.c
2
apply.c
@@ -76,10 +76,12 @@ static int parse_ignorewhitespace_option(struct apply_state *state,
|
||||
}
|
||||
|
||||
int init_apply_state(struct apply_state *state,
|
||||
struct repository *repo,
|
||||
const char *prefix)
|
||||
{
|
||||
memset(state, 0, sizeof(*state));
|
||||
state->prefix = prefix;
|
||||
state->repo = repo;
|
||||
state->apply = 1;
|
||||
state->line_termination = '\n';
|
||||
state->p_value = 1;
|
||||
|
||||
Reference in New Issue
Block a user