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

Function app_test_git

tests/test_daemon_application.c:814–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812}
813
814static int app_test_git(const char *root, const char *operation, const char *argument_one,
815 const char *argument_two) {
816 const char *git = "git";
817#ifdef _WIN32
818 char git_executable[APP_TEST_PATH_CAP];
819 const char *resolved = cbm_find_cli("git", cbm_get_home_dir());
820 int resolved_length =
821 resolved ? snprintf(git_executable, sizeof(git_executable), "%s", resolved) : -1;
822 if (resolved_length <= 0 || (size_t)resolved_length >= sizeof(git_executable)) {
823 return -1;
824 }
825 git = git_executable;
826#endif
827 const char *argv[] = {git, "-C", root, operation, argument_one, argument_two, NULL};
828 cbm_proc_opts_t options = {0};
829 cbm_proc_result_t result = {0};
830 options.bin = git;
831 options.argv = argv;
832 options.quiet_timeout_ms = 10000;
833 return cbm_subprocess_run(&options, &result) == 0 && result.outcome == CBM_PROC_CLEAN ? 0 : -1;
834}
835
836/* Rebase guard: restricted MCP profiles are a property of one authenticated
837 * daemon session. Before profile propagation, the daemon silently created a

Callers 1

Calls 3

cbm_find_cliFunction · 0.85
cbm_get_home_dirFunction · 0.85
cbm_subprocess_runFunction · 0.85

Tested by

no test coverage detected