From 6d2df284e7f4d7cd9f46992282ef59a72a9db527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 13 Aug 2018 18:14:22 +0200 Subject: dir.c: remove an implicit dependency on the_index in pathspec code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the match_patchspec API and friends take an index_state instead of assuming the_index in dir.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- archive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archive.c') diff --git a/archive.c b/archive.c index 31de1bba52b..c81e35bf235 100644 --- a/archive.c +++ b/archive.c @@ -313,7 +313,7 @@ static int reject_entry(const struct object_id *oid, struct strbuf *base, struct strbuf sb = STRBUF_INIT; strbuf_addbuf(&sb, base); strbuf_addstr(&sb, filename); - if (!match_pathspec(context, sb.buf, sb.len, 0, NULL, 1)) + if (!match_pathspec(&the_index, context, sb.buf, sb.len, 0, NULL, 1)) ret = READ_TREE_RECURSIVE; strbuf_release(&sb); } -- cgit v1.2.3