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

Function cbm_artifact_exists

src/pipeline/artifact.c:787–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785/* ── Existence check ─────────────────────────────────────────────── */
786
787bool cbm_artifact_exists(const char *repo_path) {
788 if (!repo_path) {
789 return false;
790 }
791
792 char zst_path[CBM_SZ_4K];
793 artifact_path(zst_path, sizeof(zst_path), repo_path, CBM_ARTIFACT_FILENAME);
794
795 struct stat st;
796 if (stat(zst_path, &st) != 0 || st.st_size == 0) {
797 return false;
798 }
799
800 /* Check schema version is compatible */
801 int version = read_metadata_version(repo_path);
802 return version >= 0 && version <= CBM_ARTIFACT_SCHEMA_VERSION;
803}
804
805/* ── Commit hash extraction ──────────────────────────────────────── */
806

Callers 6

try_artifact_bootstrapFunction · 0.85
export_after_publishFunction · 0.85
test_pipeline.cFile · 0.85
test_artifact.cFile · 0.85
repro_issue434.cFile · 0.85

Calls 3

artifact_pathFunction · 0.85
read_metadata_versionFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected