From 7f944e264ebe2fcf9a2c228a9fc9463ab3274d39 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:21 +0200 Subject: convert.c: remove an implicit dependency on the_index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the convert API take an index_state instead of assuming the_index in convert.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 --- sha1-file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sha1-file.c') diff --git a/sha1-file.c b/sha1-file.c index dfa8a35d68..0016d46052 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -1860,7 +1860,7 @@ static int index_stream_convert_blob(struct object_id *oid, int fd, struct strbuf sbuf = STRBUF_INIT; assert(path); - assert(would_convert_to_git_filter_fd(path)); + assert(would_convert_to_git_filter_fd(&the_index, path)); convert_to_git_filter_fd(&the_index, path, fd, &sbuf, get_conv_flags(flags)); @@ -1950,7 +1950,7 @@ int index_fd(struct object_id *oid, int fd, struct stat *st, * Call xsize_t() only when needed to avoid potentially unnecessary * die() for large files. */ - if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(path)) + if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(&the_index, path)) ret = index_stream_convert_blob(oid, fd, path, flags); else if (!S_ISREG(st->st_mode)) ret = index_pipe(oid, fd, type, path, flags); -- cgit v1.2.3