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

Function cbm_popen_git

src/foundation/compat_fs.c:408–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408FILE *cbm_popen_git(const char *cmd) {
409 /* Fail closed: without the scrubbed block the child would inherit a
410 * caller's GIT_DIR and read the wrong repository (#2003). */
411 wchar_t *env = cbm_git_child_env_block();
412 if (!env) {
413 cbm_log_warn("compat.popen_git_env_failed", "stage", "env_block");
414 return NULL;
415 }
416 FILE *fp = cbm_popen_read_isolated(cmd, env);
417 cbm_git_child_env_free(env); /* CreateProcessW copies the block into the child */
418 return fp;
419}
420
421int cbm_pclose(FILE *f) {
422 InitOnceExecuteOnce(&g_popen_once, cbm_popen_init, NULL, NULL);

Callers 10

git_capture_intoFunction · 0.85
mx_churn_scanFunction · 0.85
mx_remote_urlFunction · 0.85
parse_git_logFunction · 0.85
git_head_hashFunction · 0.85
git_run_okFunction · 0.85
git_capture_fullFunction · 0.85
ensure_gitattributesFunction · 0.85
test_subprocess.cFile · 0.85

Calls 8

cbm_git_child_env_blockFunction · 0.85
cbm_popen_read_isolatedFunction · 0.85
cbm_git_child_env_freeFunction · 0.85
cbm_git_child_envpFunction · 0.85
cbm_popen_spawn_shFunction · 0.85
cbm_popen_git_waitFunction · 0.85
pthread_mutex_lockFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected