Skip to content

Commit

Permalink
diff: pass the whole diff_options to diffcore_apply_filter()
Browse files Browse the repository at this point in the history
The --diff-filter=<arg> option given by the user is kept as a
string, and passed to the underlying diffcore_apply_filter()
function as a string for each resulting path we run number of
strchr() to see if each class of change among ACDMRTXUB is meant to
be given.

Change the function signature to pass the whole diff_options, so
that we can pre-parse this string in the next patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jul 17, 2013
1 parent f59bebb commit 949226f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -4509,11 +4509,13 @@ void diff_flush(struct diff_options *options)
}
}

static void diffcore_apply_filter(const char *filter)
static void diffcore_apply_filter(struct diff_options *options)
{
int i;
struct diff_queue_struct *q = &diff_queued_diff;
struct diff_queue_struct outq;
const char *filter = options->filter;

DIFF_QUEUE_CLEAR(&outq);

if (!filter)
Expand Down Expand Up @@ -4661,7 +4663,7 @@ void diffcore_std(struct diff_options *options)
if (!options->found_follow)
/* See try_to_follow_renames() in tree-diff.c */
diff_resolve_rename_copy();
diffcore_apply_filter(options->filter);
diffcore_apply_filter(options);

if (diff_queued_diff.nr && !DIFF_OPT_TST(options, DIFF_FROM_CONTENTS))
DIFF_OPT_SET(options, HAS_CHANGES);
Expand Down

0 comments on commit 949226f

Please sign in to comment.