diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-08-13 19:14:21 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-14 00:14:42 +0300 |
commit | 7f944e264ebe2fcf9a2c228a9fc9463ab3274d39 (patch) | |
tree | b745e284c241468980b72f7bfd7038dce8757eab /sha1-file.c | |
parent | 7a400a2c0270f2085b70690e4ddbfd8d141e69ca (diff) |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |