summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 17:57:24 +0200
committerJunio C Hamano <gitster@pobox.com>2018-09-21 09:48:10 -0700
commite675765235001c382ba30d336bb69618296c012b (patch)
treed6a5cb53c2238c67f3569fa6512618d86ae48403 /diff.c
parent38bbc2ea39372ce1b7eb494b31948f4a8a903f88 (diff)
downloadgit-e675765235001c382ba30d336bb69618296c012b.tar.gz
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.c')
-rw-r--r--diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 0848ac65df..1bcc0818df 100644
--- a/diff.c
+++ b/diff.c
@@ -4390,12 +4390,12 @@ static void run_checkdiff(struct diff_filepair *p, struct diff_options *o)
builtin_checkdiff(name, other, attr_path, p->one, p->two, o);
}
-void diff_setup(struct diff_options *options)
+void repo_diff_setup(struct repository *r, struct diff_options *options)
{
memcpy(options, &default_diff_options, sizeof(*options));
options->file = stdout;
- options->repo->index = &the_index;
+ options->repo = r;
options->abbrev = DEFAULT_ABBREV;
options->line_termination = '\n';