Skip to content

Commit

Permalink
pickaxe: give diff_grep the same signature as has_changes
Browse files Browse the repository at this point in the history
Change diff_grep() to match the signature of has_changes() as a
preparation for the next patch that will use function pointers to
the two.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Oct 7, 2011
1 parent 5d176fb commit db99cb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions diffcore-pickaxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ static void fill_one(struct diff_filespec *one,
}
}

static int diff_grep(struct diff_filepair *p, regex_t *regexp, struct diff_options *o)
static int diff_grep(struct diff_filepair *p, struct diff_options *o,
regex_t *regexp, kwset_t kws)
{
regmatch_t regmatch;
struct userdiff_driver *textconv_one = NULL;
Expand Down Expand Up @@ -114,7 +115,7 @@ static void diffcore_pickaxe_grep(struct diff_options *o)
/* Showing the whole changeset if needle exists */
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
if (diff_grep(p, &regex, o))
if (diff_grep(p, o, &regex, NULL))
goto out; /* do not munge the queue */
}

Expand All @@ -129,7 +130,7 @@ static void diffcore_pickaxe_grep(struct diff_options *o)
/* Showing only the filepairs that has the needle */
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
if (diff_grep(p, &regex, o))
if (diff_grep(p, o, &regex, NULL))
diff_q(&outq, p);
else
diff_free_filepair(p);
Expand Down

0 comments on commit db99cb7

Please sign in to comment.