MCPcopy Create free account
hub / github.com/git/git / diffgrep_consume

Function diffgrep_consume

diffcore-pickaxe.c:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24};
25
26static int diffgrep_consume(void *priv, char *line, unsigned long len)
27{
28 struct diffgrep_cb *data = priv;
29 regmatch_t regmatch;
30
31 if (line[0] != '+' && line[0] != '-')
32 return 0;
33 if (data->hit)
34 BUG("Already matched in diffgrep_consume! Broken xdiff_emit_line_fn?");
35 if (!regexec_buf(data->regexp, line + 1, len - 1, 1,
36 &regmatch, 0)) {
37 data->hit = 1;
38 return 1;
39 }
40 return 0;
41}
42
43static int diff_grep(mmfile_t *one, mmfile_t *two,
44 struct diff_options *o,

Callers

nothing calls this directly

Calls 1

regexec_bufFunction · 0.85

Tested by

no test coverage detected