Skip to content

Commit

Permalink
diff-no-index: do not take a redundant prefix argument
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jan 21, 2016
1 parent 833e482 commit e5f7a5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion builtin/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions diff-no-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; ) {
Expand Down
2 changes: 1 addition & 1 deletion diff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e5f7a5d

Please sign in to comment.