diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-09-21 17:57:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-21 18:48:10 +0200 |
commit | e675765235001c382ba30d336bb69618296c012b (patch) | |
tree | d6a5cb53c2238c67f3569fa6512618d86ae48403 /diff.h | |
parent | grep.c: remove implicit dependency on the_index (diff) | |
download | git-e675765235001c382ba30d336bb69618296c012b.tar.xz git-e675765235001c382ba30d336bb69618296c012b.zip |
diff.c: remove implicit dependency on the_index
A new variant repo_diff_setup() is added that takes 'struct repository *'
and diff_setup() becomes a thin macro around it that is protected by
NO_THE_REPOSITORY_COMPATIBILITY_MACROS, similar to NO_THE_INDEX_....
The plan is these macros will always be defined for all library files
and the macros are only accessible in builtin/
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 'diff.h')
-rw-r--r-- | diff.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -336,7 +336,10 @@ int git_diff_basic_config(const char *var, const char *value, void *cb); int git_diff_heuristic_config(const char *var, const char *value, void *cb); void init_diff_ui_defaults(void); int git_diff_ui_config(const char *var, const char *value, void *cb); -void diff_setup(struct diff_options *); +#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS +#define diff_setup(diffopts) repo_diff_setup(the_repository, diffopts) +#endif +void repo_diff_setup(struct repository *, struct diff_options *); int diff_opt_parse(struct diff_options *, const char **, int, const char *); void diff_setup_done(struct diff_options *); int git_config_rename(const char *var, const char *value); @@ -426,7 +429,7 @@ int diff_flush_patch_id(struct diff_options *, struct object_id *, int); int diff_result_code(struct diff_options *, int); -void diff_no_index(struct rev_info *, int, const char **); +void diff_no_index(struct repository *, struct rev_info *, int, const char **); int index_differs_from(const char *def, const struct diff_flags *flags, int ita_invisible_in_index); |