summaryrefslogtreecommitdiff
path: root/convert.h
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 /convert.h
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 'convert.h')
-rw-r--r--convert.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/convert.h b/convert.h
index 0a0fa15..6d0ee88 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 *);