From e675765235001c382ba30d336bb69618296c012b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 21 Sep 2018 17:57:24 +0200 Subject: diff.c: remove implicit dependency on the_index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- diff-no-index.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index 0ed5f0f496..9414e922d1 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -233,7 +233,8 @@ static void fixup_paths(const char **path, struct strbuf *replacement) } } -void diff_no_index(struct rev_info *revs, +void diff_no_index(struct repository *r, + struct rev_info *revs, int argc, const char **argv) { int i; @@ -241,7 +242,11 @@ void diff_no_index(struct rev_info *revs, struct strbuf replacement = STRBUF_INIT; const char *prefix = revs->prefix; - diff_setup(&revs->diffopt); + /* + * FIXME: --no-index should not look at index and we should be + * able to pass NULL repo. Maybe later. + */ + repo_diff_setup(r, &revs->diffopt); for (i = 1; i < argc - 2; ) { int j; if (!strcmp(argv[i], "--no-index")) -- cgit v1.2.3