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

Function clone_to_b

tests/test_artifact.c:883–896  ·  view source on GitHub ↗

Clones g_repo (A) into /work/repo (B) so both share the basename "repo" * and thus the derived project name — required for artifact bootstrap. */

Source from the content-addressed store, hash-verified

881/* Clones g_repo (A) into <tmp>/work/repo (B) so both share the basename "repo"
882 * and thus the derived project name — required for artifact bootstrap. */
883static bool clone_to_b(char *repoB_out, size_t repoB_sz) {
884 char work[1024];
885 snprintf(work, sizeof(work), "%s/work", g_tmpdir);
886 cbm_mkdir_p(work, 0755);
887 snprintf(repoB_out, repoB_sz, "%s/repo", work);
888 if (runf("git clone -q \"%s\" \"%s\"", g_repo, repoB_out) != 0) {
889 return false;
890 }
891 /* A clone does NOT inherit the source repo's local user config, and CI
892 * runners have no global identity -- `git commit` then exits 128. Set it
893 * on the clone the same way git_init() does for the source repo. */
894 return runf("git -C \"%s\" config user.email t@t.com", repoB_out) == 0 &&
895 runf("git -C \"%s\" config user.name t", repoB_out) == 0;
896}
897
898TEST(artifact_export_marks_clean_basis) {
899 setup_artifact_test();

Callers 1

test_artifact.cFile · 0.85

Calls 2

cbm_mkdir_pFunction · 0.85
runfFunction · 0.85

Tested by

no test coverage detected