(files: string[])
| 166 | } |
| 167 | |
| 168 | export 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 | |
| 199 | export function getCommitMessages(mergeBase: string, head: string): string { |
| 200 | return execFileSync("git", ["log", "--oneline", `${mergeBase}..${head}`], { |
no test coverage detected