From 7f944e264ebe2fcf9a2c228a9fc9463ab3274d39 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy 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 --- convert.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'convert.h') diff --git a/convert.h b/convert.h index 0a0fa15b58..6d0ee887ed 100644 --- a/convert.h +++ b/convert.h @@ -60,15 +60,18 @@ extern char *check_roundtrip_encoding; const char *get_cached_convert_stats_ascii(const struct index_state *istate, const char *path); const char *get_wt_convert_stats_ascii(const char *path); -const char *get_convert_attr_ascii(const char *path); +const char *get_convert_attr_ascii(const struct index_state *istate, + const char *path); /* returns 1 if *dst was used */ int convert_to_git(const struct index_state *istate, const char *path, const char *src, size_t len, struct strbuf *dst, int conv_flags); -int convert_to_working_tree(const char *path, const char *src, +int convert_to_working_tree(const struct index_state *istate, + const char *path, const char *src, size_t len, struct strbuf *dst); -int async_convert_to_working_tree(const char *path, const char *src, +int async_convert_to_working_tree(const struct index_state *istate, + const char *path, const char *src, size_t len, struct strbuf *dst, void *dco); int async_query_available_blobs(const char *cmd, @@ -86,7 +89,8 @@ void convert_to_git_filter_fd(const struct index_state *istate, const char *path, int fd, struct strbuf *dst, int conv_flags); -int would_convert_to_git_filter_fd(const char *path); +int would_convert_to_git_filter_fd(const struct index_state *istate, + const char *path); /***************************************************************** * @@ -96,7 +100,8 @@ int would_convert_to_git_filter_fd(const char *path); struct stream_filter; /* opaque */ -struct stream_filter *get_stream_filter(const char *path, +struct stream_filter *get_stream_filter(const struct index_state *istate, + const char *path, const struct object_id *); void free_stream_filter(struct stream_filter *); int is_null_stream_filter(struct stream_filter *); -- cgit v1.3-5-g9baa