path: root/apply.c
diff options
authorNguyễn Thái Ngọc Duy <>2018-08-13 16:14:39 (GMT)
committerJunio C Hamano <>2018-08-13 21:14:44 (GMT)
commit82ea77eca7af238f1ee65f5cbc945a01e16ee97a (patch)
treeb22a81980f6a20a4e9148233f124f5d6bb5c4270 /apply.c
parent332a82a52222da253cd5023cd4c5cde2d51636b9 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'apply.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/apply.c b/apply.c
index 572cd63..3704850 100644
--- a/apply.c
+++ b/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;