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

Function kustomize_folder

src/pipeline/pass_pkgmap.c:2246–2259  ·  view source on GitHub ↗

The Folder of a directory entry: plain, or `proj.pkg.base/` when a file * beside it shares the stem (cbm_stem_marks_t). */

Source from the content-addressed store, hash-verified

2244/* The Folder of a directory entry: plain, or `proj.pkg.base/` when a file
2245 * beside it shares the stem (cbm_stem_marks_t). */
2246static const cbm_gbuf_node_t *kustomize_folder(const cbm_pipeline_ctx_t *ctx, const char *path) {
2247 char *fqn = cbm_pipeline_fqn_folder(ctx->project_name, path);
2248 if (!fqn) {
2249 return NULL;
2250 }
2251 const cbm_gbuf_node_t *n = cbm_gbuf_find_by_qn(ctx->gbuf, fqn);
2252 if (!n || !n->label || strcmp(n->label, "Folder") != 0) {
2253 char marked[PKGMAP_PATH_BUF];
2254 int len = snprintf(marked, sizeof(marked), "%s/", fqn);
2255 n = len > 0 && (size_t)len < sizeof(marked) ? cbm_gbuf_find_by_qn(ctx->gbuf, marked) : NULL;
2256 }
2257 free(fqn);
2258 return n && n->label && strcmp(n->label, "Folder") == 0 ? n : NULL;
2259}
2260
2261/* A kustomization entry is a path relative to the kustomization's own
2262 * directory -- a manifest file or a directory -- or a remote base; it never

Callers 1

resolve_kustomize_entryFunction · 0.85

Calls 2

cbm_pipeline_fqn_folderFunction · 0.85
cbm_gbuf_find_by_qnFunction · 0.85

Tested by

no test coverage detected