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

Function app_test_git

tests/test_daemon_application.c:813–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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