MCPcopy
hub / github.com/openai/codex-plugin-cc / measureGitOutputBytes

Function measureGitOutputBytes

plugins/codex/scripts/lib/git.mjs:39–51  ·  view source on GitHub ↗
(cwd, args, maxBytes)

Source from the content-addressed store, hash-verified

37}
38
39function measureGitOutputBytes(cwd, args, maxBytes) {
40 const result = git(cwd, args, { maxBuffer: maxBytes + 1 });
41 if (result.error && /** @type {NodeJS.ErrnoException} */ (result.error).code === "ENOBUFS") {
42 return maxBytes + 1;
43 }
44 if (result.error) {
45 throw result.error;
46 }
47 if (result.status !== 0) {
48 throw new Error(formatCommandFailure(result));
49 }
50 return Buffer.byteLength(result.stdout, "utf8");
51}
52
53function measureCombinedGitOutputBytes(cwd, argSets, maxBytes) {
54 let totalBytes = 0;

Callers 2

collectReviewContextFunction · 0.85

Calls 2

formatCommandFailureFunction · 0.90
gitFunction · 0.85

Tested by

no test coverage detected