diff-no-index: do not take a redundant prefix argument
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>
Nguyễn Thái Ngọc Duy committed
Jan 20, 2016 at 18:06 UTC
e5f7a5d16f2c890e7dda96e5681ee8f6687b45e4
3 files changed
+4
-4
builtin/diff.c
+1
-1
@@ -341,7 +341,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
341
}
342
if (no_index)
343
/* If this is a no-index diff, just run it and exit there. */
344
- diff_no_index(&rev, argc, argv, prefix);
344
+ diff_no_index(&rev, argc, argv);
345
346
/* Otherwise, we are doing the usual "git" diff */
347
rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
diff-no-index.c
+2
-2
@@ -239,12 +239,12 @@ static void fixup_paths(const char **path, struct strbuf *replacement)
239
}
240
241
void diff_no_index(struct rev_info *revs,
242
- int argc, const char **argv,
243
- const char *prefix)
242
+ int argc, const char **argv)
243
{
244
int i, prefixlen;
245
const char *paths[2];
246
struct strbuf replacement = STRBUF_INIT;
247
+ const char *prefix = revs->prefix;
248
249
diff_setup(&revs->diffopt);
250
for (i = 1; i < argc - 2; ) {
diff.h
+1
-1
@@ -345,7 +345,7 @@ extern int diff_flush_patch_id(struct diff_options *, unsigned char *);
345
346
extern int diff_result_code(struct diff_options *, int);
347
348
-extern void diff_no_index(struct rev_info *, int, const char **, const char *);
348
+extern void diff_no_index(struct rev_info *, int, const char **);
349
350
extern int index_differs_from(const char *def, int diff_flags);
351