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

Function sh_link_hit

src/pipeline/pass_shell.c:3754–3775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3752}
3753
3754static int sh_link_hit(cbm_pipeline_ctx_t *ctx, const sh_hit_t *x, int64_t src,
3755 CBMHashTable *modules) {
3756 if (x->spawn) {
3757 return src > 0 ? sh_link_spawn(ctx, src, x, modules) : 0;
3758 }
3759 if (x->http) {
3760 return sh_link_http(ctx, src, x);
3761 }
3762 int64_t tgt = x->tgt > 0 ? x->tgt : sh_external_chart(ctx, x->ext, x->file);
3763 if (src <= 0 || tgt <= 0 || src == tgt) {
3764 return 0;
3765 }
3766 char esc[CBM_SZ_1K];
3767 char ci[CBM_SZ_1K];
3768 char props[CBM_SZ_4K];
3769 cbm_json_escape(esc, (int)sizeof(esc), x->path ? x->path : "");
3770 sh_ci_props(x, ci, sizeof(ci));
3771 snprintf(props, sizeof(props), "{\"via\":\"%s\",\"%s\":\"%s\"%s%s,\"line\":%d}", x->via,
3772 x->chart ? "chart" : "path", esc, x->tgt > 0 ? "" : ",\"external\":true", ci, x->line);
3773 cbm_gbuf_insert_edge(ctx->gbuf, src, tgt, "DEPLOYS", props);
3774 return SKIP_ONE;
3775}
3776
3777static int sh_link(cbm_pipeline_ctx_t *ctx, const sh_hits_t *h) {
3778 CBMHashTable *files = cbm_ht_create(0);

Callers 1

sh_linkFunction · 0.85

Calls 6

sh_link_spawnFunction · 0.85
sh_link_httpFunction · 0.85
sh_external_chartFunction · 0.85
cbm_json_escapeFunction · 0.85
sh_ci_propsFunction · 0.85
cbm_gbuf_insert_edgeFunction · 0.85

Tested by

no test coverage detected