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

Function gi_store_pattern

src/discover/gitignore_checked_parse.c:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41static bool gi_store_pattern(gi_parse_t *parse, const gi_view_t *view) {
42 bool fault = parse->fault == GI_FAULT_PATTERN && parse->count == 0;
43 char *text = gi_allocate(parse->guard, view->length + 1, fault);
44 if (!text) {
45 return false;
46 }
47 for (size_t i = 0; i <= view->length; i++) {
48 if (!gi_work(parse->guard, 1)) {
49 return false;
50 }
51 text[i] = i == view->length ? '\0' : view->text[i];
52 }
53 gi_pattern_t row = {.pattern = text,
54 .negated = view->negated,
55 .dir_only = view->dir_only,
56 .rooted = view->rooted};
57 parse->program->rows[parse->count++] = row;
58 return true;
59}
60
61static bool gi_parse_pass(gi_parse_t *parse) {
62 size_t cursor = 0;

Callers 1

gi_parse_passFunction · 0.85

Calls 2

gi_allocateFunction · 0.85
gi_workFunction · 0.85

Tested by

no test coverage detected