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

Function gf_rev_metadata

src/mcp/test_impact_git.c:734–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732#endif
733
734static bool gf_rev_metadata(cbm_git_facts_t *facts, const char *option, bool absolute,
735 const char **out, cbm_git_facts_error_t *error) {
736 const char *args[] = {"rev-parse", "--path-format=absolute", option};
737 gf_result_t result;
738 if (!gf_run(facts, args, 3, false, &result, error) ||
739 !gf_owned_line(facts, &result.out, out, error))
740 return false;
741#ifdef _WIN32
742 if (absolute && !(*out = gf_native_metadata_path(facts, *out)))
743 return gf_error(error, CBM_GIT_FACTS_OOM, "Cannot retain Git metadata path");
744#endif
745 if (absolute && !gf_absolute(*out))
746 return gf_error(error, CBM_GIT_FACTS_COMMAND, "Git metadata path is not absolute");
747 return true;
748}
749
750/* Metadata queries call gf_run directly; the executor must not call this guard.
751 * This checks persistent topology consistency, not an atomic filesystem snapshot.

Callers 2

gf_topology_guardFunction · 0.85
gf_open_identityFunction · 0.85

Calls 5

gf_runFunction · 0.85
gf_owned_lineFunction · 0.85
gf_native_metadata_pathFunction · 0.85
gf_errorFunction · 0.85
gf_absoluteFunction · 0.70

Tested by

no test coverage detected