From 26d024ecf0e2e5bd697714b95930bb6008d85f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 21 Sep 2018 17:57:37 +0200 Subject: ws.c: remove implicit dependency on the_index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- apply.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apply.c') diff --git a/apply.c b/apply.c index 571b89c2e0..fdae1d423b 100644 --- a/apply.c +++ b/apply.c @@ -2131,10 +2131,12 @@ static int parse_chunk(struct apply_state *state, char *buffer, unsigned long si if (!use_patch(state, patch)) patch->ws_rule = 0; + else if (patch->new_name) + patch->ws_rule = whitespace_rule(state->repo->index, + patch->new_name); else - patch->ws_rule = whitespace_rule(patch->new_name - ? patch->new_name - : patch->old_name); + patch->ws_rule = whitespace_rule(state->repo->index, + patch->old_name); patchsize = parse_single_patch(state, buffer + offset + hdrsize, -- cgit v1.2.3