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

Function sh_hit_push

src/pipeline/pass_shell.c:1313–1325  ·  view source on GitHub ↗

Record hit `x` of command `cmd`: its file, line and CI context are the * state's; ext / path are copied. */

Source from the content-addressed store, hash-verified

1311/* Record hit `x` of command `cmd`: its file, line and CI context are the
1312 * state's; ext / path are copied. */
1313static void sh_hit_push(sh_t *s, TSNode cmd, sh_hit_t x) {
1314 sh_hits_t *h = s->hits;
1315 if (!sh_grow((void **)&h->items, &h->cap, h->count, sizeof(*h->items))) {
1316 return;
1317 }
1318 x.file = s->file;
1319 x.line = (int)ts_node_start_point(cmd).row + SKIP_ONE + s->line_base;
1320 x.ext = x.ext ? cbm_arena_strdup(&h->arena, x.ext) : NULL;
1321 x.path = x.path ? cbm_arena_strdup(&h->arena, x.path) : NULL;
1322 x.ci = s->ci;
1323 x.job = s->job ? cbm_arena_strdup(&h->arena, s->job) : NULL;
1324 h->items[h->count++] = x;
1325}
1326
1327static void sh_hit(sh_t *s, TSNode cmd, const char *via, const sh_target_t *t, const char *ext,
1328 bool chart) {

Callers 6

sh_hitFunction · 0.85
sh_spawn_scriptFunction · 0.85
sh_makeFunction · 0.85
sh_spawnFunction · 0.85
sh_httpFunction · 0.85
sh_buildFunction · 0.85

Calls 2

sh_growFunction · 0.85
cbm_arena_strdupFunction · 0.50

Tested by

no test coverage detected