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

Function gf_capture_create

src/mcp/test_impact_git.c:337–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337static bool gf_capture_create(cbm_git_facts_t *facts, gf_capture_t *capture,
338 cbm_git_facts_error_t *error) {
339 memset(capture, 0, sizeof(*capture));
340 if (!gf_private_directory(facts, capture->directory, error))
341 return false;
342 int a = snprintf(capture->out, sizeof(capture->out), "%s/stdout", capture->directory);
343 int b = snprintf(capture->err, sizeof(capture->err), "%s/stderr", capture->directory);
344 if (a < 0 || b < 0 || (size_t)a >= sizeof(capture->out) || (size_t)b >= sizeof(capture->err)) {
345 capture->out[0] = capture->err[0] = '\0';
346 (void)gf_capture_cleanup(capture);
347 return gf_error(error, CBM_GIT_FACTS_IO, "Capture path exceeds supported length");
348 }
349 return true;
350}
351
352/* The private writer is closed before spawn. Only canonical OID lines reach
353 * this transport; the child opens its independent read-only binary handle. */

Callers 1

gf_run_inputFunction · 0.85

Calls 3

gf_private_directoryFunction · 0.85
gf_capture_cleanupFunction · 0.85
gf_errorFunction · 0.85

Tested by

no test coverage detected