MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / gf_active_line

Function gf_active_line

src/mcp/test_impact_git.c:622–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

620}
621
622static bool gf_active_line(cbm_git_facts_t *facts, const cbm_git_bytes_t *bytes,
623 const unsigned char **text, size_t *length,
624 cbm_git_facts_error_t *error) {
625 if (!facts->batch_budget)
626 return gf_line(bytes, text, length) ||
627 gf_error(error, CBM_GIT_FACTS_COMMAND, "Malformed Git metadata line");
628 if (!bytes->length || bytes->data[bytes->length - 1] != '\n')
629 return gf_error(error, CBM_GIT_FACTS_COMMAND, "Malformed Git metadata line");
630 size_t n = bytes->length - 1;
631#ifdef _WIN32
632 if (n && bytes->data[n - 1] == '\r')
633 n--;
634#endif
635 for (size_t at = 0; at < n; at++) {
636 if ((at & 65535u) == 0 && !gf_gate(facts, error))
637 return false;
638 unsigned char c = bytes->data[at];
639 if (!c || c == '\n' || c == '\r')
640 return gf_error(error, CBM_GIT_FACTS_COMMAND, "Malformed Git metadata line");
641 }
642 *text = bytes->data;
643 *length = n;
644 return gf_gate(facts, error);
645}
646
647static bool gf_owned_line(cbm_git_facts_t *facts, const cbm_git_bytes_t *bytes, const char **out,
648 cbm_git_facts_error_t *error) {

Callers 1

gf_owned_lineFunction · 0.85

Calls 3

gf_lineFunction · 0.85
gf_errorFunction · 0.85
gf_gateFunction · 0.85

Tested by

no test coverage detected