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

Function gitenv_probe_script

tests/test_subprocess.c:1694–1703  ·  view source on GitHub ↗

exit 0: no git repo-local var is set and CBM_GITENV_KEEP=kept; exit 3: a git * var leaked; exit 4: the unrelated variable was lost. */

Source from the content-addressed store, hash-verified

1692/* exit 0: no git repo-local var is set and CBM_GITENV_KEEP=kept; exit 3: a git
1693 * var leaked; exit 4: the unrelated variable was lost. */
1694static void gitenv_probe_script(char *buf, size_t cap) {
1695 size_t n = (size_t)snprintf(buf, cap, "[ \"$CBM_GITENV_KEEP\" = kept ] || exit 4;");
1696 for (int i = 0; i < CBM_GIT_REPO_ENV_VAR_COUNT && n < cap; i++) {
1697 n += (size_t)snprintf(buf + n, cap - n, " [ -z \"${%s+x}\" ] || exit 3;",
1698 cbm_git_repo_env_vars[i]);
1699 }
1700 if (n < cap) {
1701 (void)snprintf(buf + n, cap - n, " exit 0");
1702 }
1703}
1704
1705static int gitenv_spawn_probe(bool strip) {
1706 char script[2048];

Callers 2

gitenv_spawn_probeFunction · 0.85
test_subprocess.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected