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

Function git_read_line

tests/test_git_context.c:135–146  ·  view source on GitHub ↗

First output line of `git -C dir ` (run with the test's clean env). */

Source from the content-addressed store, hash-verified

133
134/* First output line of `git -C dir <args>` (run with the test's clean env). */
135static void git_read_line(const char *dir, const char *args, char *out, size_t out_sz) {
136 char cmd[1024];
137 out[0] = '\0';
138 snprintf(cmd, sizeof(cmd), "git -C \"%s\" %s 2>/dev/null", dir, args);
139 FILE *fp = popen(cmd, "r");
140 if (!fp)
141 return;
142 if (fgets(out, (int)out_sz, fp)) {
143 out[strcspn(out, "\r\n")] = '\0';
144 }
145 pclose(fp);
146}
147
148/* root/decoy: a repo on branch decoy-branch with coupled a.go+b.go commits;
149 * root/fixture: a repo on branch fixture-branch; root/plain: not a repo. */

Callers 1

test_git_context.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected