summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-17 21:19:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-17 21:19:24 (GMT)
commit949226fe77beb1027bd5ac7be56fe002236d6cad (patch)
treea8fde9f3c4ba8c545b171bfe95dac049d257d2e8 /diff.c
parentf59bebb78edb26e4f66c2754bc4d168c5d4ebb4a (diff)
downloadgit-949226fe77beb1027bd5ac7be56fe002236d6cad.zip
git-949226fe77beb1027bd5ac7be56fe002236d6cad.tar.gz
git-949226fe77beb1027bd5ac7be56fe002236d6cad.tar.bz2
diff: pass the whole diff_options to diffcore_apply_filter()
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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 649ec86..41c64f2 100644
--- a/diff.c
+++ b/diff.c
@@ -4509,11 +4509,13 @@ free_queue:
}
}
-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)
@@ -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);