summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 15:57:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-21 16:48:10 (GMT)
commite675765235001c382ba30d336bb69618296c012b (patch)
treed6a5cb53c2238c67f3569fa6512618d86ae48403 /diff-no-index.c
parent38bbc2ea39372ce1b7eb494b31948f4a8a903f88 (diff)
downloadgit-e675765235001c382ba30d336bb69618296c012b.zip
git-e675765235001c382ba30d336bb69618296c012b.tar.gz
git-e675765235001c382ba30d336bb69618296c012b.tar.bz2
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-no-index.c')
-rw-r--r--diff-no-index.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 0ed5f0f..9414e92 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"))