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

Function is_conflict_marker

diff.c:3522–3543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3520};
3521
3522static int is_conflict_marker(const char *line, int marker_size, unsigned long len)
3523{
3524 char firstchar;
3525 int cnt;
3526
3527 if (len < marker_size + 1)
3528 return 0;
3529 firstchar = line[0];
3530 switch (firstchar) {
3531 case '=': case '>': case '<': case '|':
3532 break;
3533 default:
3534 return 0;
3535 }
3536 for (cnt = 1; cnt < marker_size; cnt++)
3537 if (line[cnt] != firstchar)
3538 return 0;
3539 /* line[1] through line[marker_size-1] are same as firstchar */
3540 if (len < marker_size + 1 || !isspace(line[marker_size]))
3541 return 0;
3542 return 1;
3543}
3544
3545static void checkdiff_consume_hunk(void *priv,
3546 long ob UNUSED, long on UNUSED,

Callers 1

checkdiff_consumeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected