MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / getUntrackedDiff

Function getUntrackedDiff

packages/cli/src/git.ts:168–197  ·  view source on GitHub ↗
(files: string[])

Source from the content-addressed store, hash-verified

166}
167
168export function getUntrackedDiff(files: string[]): string {
169 const patches: string[] = [];
170 for (const file of files) {
171 try {
172 execFileSync(
173 "git",
174 [
175 "diff",
176 "--no-index",
177 "--no-color",
178 "--src-prefix=a/",
179 "--dst-prefix=b/",
180 "--",
181 "/dev/null",
182 file,
183 ],
184 {
185 encoding: "utf8",
186 stdio: ["ignore", "pipe", "ignore"],
187 maxBuffer: 50 * 1024 * 1024,
188 },
189 );
190 } catch (err: unknown) {
191 if (hasStringStdout(err)) {
192 patches.push(err.stdout);
193 }
194 }
195 }
196 return patches.join("\n");
197}
198
199export function getCommitMessages(mergeBase: string, head: string): string {
200 return execFileSync("git", ["log", "--oneline", `${mergeBase}..${head}`], {

Callers 1

buildWorkingTreeDiffFunction · 0.85

Calls 1

hasStringStdoutFunction · 0.85

Tested by

no test coverage detected