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

Function match_one_pattern

grep.c:1010–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008}
1009
1010static int match_one_pattern(struct grep_pat *p,
1011 const char *bol, const char *eol,
1012 enum grep_context ctx, regmatch_t *pmatch,
1013 int eflags)
1014{
1015 const char *field;
1016 size_t len;
1017
1018 if (p->token == GREP_PATTERN_HEAD) {
1019 assert(p->field < ARRAY_SIZE(header_field));
1020 field = header_field[p->field].field;
1021 len = header_field[p->field].len;
1022 if (strncmp(bol, field, len))
1023 return 0;
1024 bol += len;
1025
1026 switch (p->field) {
1027 case GREP_HEADER_AUTHOR:
1028 case GREP_HEADER_COMMITTER:
1029 strip_timestamp(bol, &eol);
1030 break;
1031 default:
1032 break;
1033 }
1034 }
1035
1036 return headerless_match_one_pattern(p, bol, eol, ctx, pmatch, eflags);
1037}
1038
1039
1040static int match_expr_eval(struct grep_opt *opt, struct grep_expr *x,

Callers 2

match_expr_evalFunction · 0.85
match_lineFunction · 0.85

Calls 2

strip_timestampFunction · 0.85

Tested by

no test coverage detected