diff-no-index: do not take a redundant prefix argument
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 20 Jan 2016 11:06:02 +0000 (18:06 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Jan 2016 18:45:11 +0000 (10:45 -0800)
Prefix is already set up in "revs". The same prefix should be used for
all options parsing. So kill the last argument. This patch does not
actually change anything because the only caller does use the same
prefix for init_revisions() and diff_no_index().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/diff.c
diff-no-index.c
diff.h
index 4326fa56bfa2021c6518c225eaa3f89b8b852e11..7b9917b03e63cab68cb18a006bb1d06c2012818e 100644 (file)
@@ -341,7 +341,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        }
        if (no_index)
                /* If this is a no-index diff, just run it and exit there. */
-               diff_no_index(&rev, argc, argv, prefix);
+               diff_no_index(&rev, argc, argv);
 
        /* Otherwise, we are doing the usual "git" diff */
        rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
index 0320605a84178ffb2ab9384b8ee9fbac7df16a73..8edc6f36906d2d9d052790ac5eef0a3ca6121d0e 100644 (file)
@@ -239,12 +239,12 @@ static void fixup_paths(const char **path, struct strbuf *replacement)
 }
 
 void diff_no_index(struct rev_info *revs,
-                  int argc, const char **argv,
-                  const char *prefix)
+                  int argc, const char **argv)
 {
        int i, prefixlen;
        const char *paths[2];
        struct strbuf replacement = STRBUF_INIT;
+       const char *prefix = revs->prefix;
 
        diff_setup(&revs->diffopt);
        for (i = 1; i < argc - 2; ) {
diff --git a/diff.h b/diff.h
index f7208ad103d4b81194e5b14e7e027a2d25388667..f61ee5494b46f40d1f9a5632746f1f9dc9accf2e 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -345,7 +345,7 @@ extern int diff_flush_patch_id(struct diff_options *, unsigned char *);
 
 extern int diff_result_code(struct diff_options *, int);
 
-extern void diff_no_index(struct rev_info *, int, const char **, const char *);
+extern void diff_no_index(struct rev_info *, int, const char **);
 
 extern int index_differs_from(const char *def, int diff_flags);