MCPcopy Index your code
hub / github.com/git/git / grep_source

Function grep_source

grep.c:1831–1853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1829}
1830
1831int grep_source(struct grep_opt *opt, struct grep_source *gs)
1832{
1833 /*
1834 * we do not have to do the two-pass grep when we do not check
1835 * buffer-wide "all-match".
1836 */
1837 if (!opt->all_match && !opt->no_body_match)
1838 return grep_source_1(opt, gs, 0);
1839
1840 /* Otherwise the toplevel "or" terms hit a bit differently.
1841 * We first clear hit markers from them.
1842 */
1843 clr_hit_marker(opt->pattern_expression);
1844 opt->body_hit = 0;
1845 grep_source_1(opt, gs, 1);
1846
1847 if (opt->all_match && !chk_hit_marker(opt->pattern_expression))
1848 return 0;
1849 if (opt->no_body_match && opt->body_hit)
1850 return 0;
1851
1852 return grep_source_1(opt, gs, 0);
1853}
1854
1855static void grep_source_init_buf(struct grep_source *gs,
1856 const char *buf,

Callers 1

grep_bufferFunction · 0.70

Calls 3

grep_source_1Function · 0.85
clr_hit_markerFunction · 0.85
chk_hit_markerFunction · 0.85

Tested by

no test coverage detected