mention use of "hooks.allownonascii" in "man githooks"
[gitweb.git] / diff-no-index.c
index 80ff17d460ed67fa4b38f8a8dfce7504b27bbb64..9414e922d164e96ffedfa2504045930b058dbc80 100644 (file)
@@ -184,7 +184,7 @@ static int queue_diff(struct diff_options *o,
        } else {
                struct diff_filespec *d1, *d2;
 
-               if (DIFF_OPT_TST(o, REVERSE_DIFF)) {
+               if (o->flags.reverse_diff) {
                        SWAP(mode1, mode2);
                        SWAP(name1, name2);
                }
@@ -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"))
@@ -276,16 +281,16 @@ void diff_no_index(struct rev_info *revs,
        if (!revs->diffopt.output_format)
                revs->diffopt.output_format = DIFF_FORMAT_PATCH;
 
-       DIFF_OPT_SET(&revs->diffopt, NO_INDEX);
+       revs->diffopt.flags.no_index = 1;
 
-       DIFF_OPT_SET(&revs->diffopt, RELATIVE_NAME);
+       revs->diffopt.flags.relative_name = 1;
        revs->diffopt.prefix = prefix;
 
        revs->max_count = -2;
        diff_setup_done(&revs->diffopt);
 
        setup_diff_pager(&revs->diffopt);
-       DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
+       revs->diffopt.flags.exit_with_status = 1;
 
        if (queue_diff(&revs->diffopt, paths[0], paths[1]))
                exit(1);