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

Function gitenv_leave

tests/test_subprocess.c:1680–1690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1678}
1679
1680static void gitenv_leave(gitenv_snapshot_t *snap) {
1681 for (int i = 0; i < CBM_GIT_REPO_ENV_VAR_COUNT; i++) {
1682 if (snap->present[i]) {
1683 setenv(cbm_git_repo_env_vars[i], snap->saved[i], 1);
1684 } else {
1685 unsetenv(cbm_git_repo_env_vars[i]);
1686 }
1687 free(snap->saved[i]);
1688 }
1689 unsetenv("CBM_GITENV_KEEP");
1690}
1691
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. */

Callers 1

test_subprocess.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected