Skip to content

Commit e5f7a5d

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 833e482 commit e5f7a5d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

builtin/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
341341
}
342342
if (no_index)
343343
/* 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);
345345

346346
/* Otherwise, we are doing the usual "git" diff */
347347
rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;

diff-no-index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ static void fixup_paths(const char **path, struct strbuf *replacement)
239239
}
240240

241241
void diff_no_index(struct rev_info *revs,
242-
int argc, const char **argv,
243-
const char *prefix)
242+
int argc, const char **argv)
244243
{
245244
int i, prefixlen;
246245
const char *paths[2];
247246
struct strbuf replacement = STRBUF_INIT;
247+
const char *prefix = revs->prefix;
248248

249249
diff_setup(&revs->diffopt);
250250
for (i = 1; i < argc - 2; ) {

diff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ extern int diff_flush_patch_id(struct diff_options *, unsigned char *);
345345

346346
extern int diff_result_code(struct diff_options *, int);
347347

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 **);
349349

350350
extern int index_differs_from(const char *def, int diff_flags);
351351

0 commit comments

Comments
 (0)