Skip to content

Commit 9537c01

Browse files
authored
Stream git log instead of buffering to fix ENOBUFS on large ranges (#122)
1 parent a0a2903 commit 9537c01

5 files changed

Lines changed: 286 additions & 122 deletions

File tree

src/base-sha.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ describe("end-to-end: concurrent trains", () => {
216216
if (repo) rmSync(repo.cwd, { recursive: true, force: true });
217217
});
218218

219-
it("naive 'use first candidate' base scans commits already shipped via the main train", () => {
219+
it("naive 'use first candidate' base scans commits already shipped via the main train", async () => {
220220
const naiveBase = candidates[0]!.commitSha!;
221-
const range = getCommitContextsBetweenShas(naiveBase, repo.mainHead, { cwd: repo.cwd });
221+
const range = await getCommitContextsBetweenShas(naiveBase, repo.mainHead, { cwd: repo.cwd });
222222
const messages = range.map((c) => c.message?.split("\n")[0]).filter(Boolean);
223223

224224
// m2 and m3 belong to 1.71.0; only m4 is the 1.72.0 bump. Using the
@@ -227,12 +227,12 @@ describe("end-to-end: concurrent trains", () => {
227227
expect(messages).toEqual(["m4 (1.72.0 HEAD)", "m3 (1.71.0 release)", "m2"]);
228228
});
229229

230-
it("findBaseSha picks the main release; range collapses to just the new bump", () => {
230+
it("findBaseSha picks the main release; range collapses to just the new bump", async () => {
231231
const result = findBaseSha(candidates, repo.mainHead, deps);
232232
expect(result).toEqual({ kind: "found", sha: repo.mainPrev });
233233
if (result.kind !== "found") return;
234234

235-
const range = getCommitContextsBetweenShas(result.sha, repo.mainHead, { cwd: repo.cwd });
235+
const range = await getCommitContextsBetweenShas(result.sha, repo.mainHead, { cwd: repo.cwd });
236236
const messages = range.map((c) => c.message?.split("\n")[0]).filter(Boolean);
237237

238238
expect(messages).toEqual(["m4 (1.72.0 HEAD)"]);

0 commit comments

Comments
 (0)