summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 16:14:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 21:14:42 (GMT)
commit7f944e264ebe2fcf9a2c228a9fc9463ab3274d39 (patch)
treeb745e284c241468980b72f7bfd7038dce8757eab /sha1-file.c
parent7a400a2c0270f2085b70690e4ddbfd8d141e69ca (diff)
downloadgit-7f944e264ebe2fcf9a2c228a9fc9463ab3274d39.zip
git-7f944e264ebe2fcf9a2c228a9fc9463ab3274d39.tar.gz
git-7f944e264ebe2fcf9a2c228a9fc9463ab3274d39.tar.bz2
convert.c: remove an implicit dependency on the_index
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1-file.c')
-rw-r--r--sha1-file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1-file.c b/sha1-file.c
index dfa8a35..0016d46 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);