summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 15:57:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-21 16:51:18 (GMT)
commit26d024ecf0e2e5bd697714b95930bb6008d85f3f (patch)
tree82e38d7c9aee2bab48766086b40125a6f8d90ef8 /apply.c
parentdcf42869eefe22150a30ed0221e01b701cea1f14 (diff)
downloadgit-26d024ecf0e2e5bd697714b95930bb6008d85f3f.zip
git-26d024ecf0e2e5bd697714b95930bb6008d85f3f.tar.gz
git-26d024ecf0e2e5bd697714b95930bb6008d85f3f.tar.bz2
ws.c: remove implicit dependency on the_index
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apply.c b/apply.c
index 571b89c..fdae1d4 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,