From 506855ab7eeb83b34bea17b66a6094845b4c2679 Mon Sep 17 00:00:00 2001 From: bluwy Date: Sat, 13 Jun 2026 02:01:40 +0800 Subject: [PATCH 1/5] Make git unit test not flaky --- src/git.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/git.ts b/src/git.ts index a8aa1d7..bf78ff5 100644 --- a/src/git.ts +++ b/src/git.ts @@ -149,5 +149,8 @@ export async function getFileChanges( }, }); + additions.sort((a, b) => a.path.localeCompare(b.path)); + deletions.sort((a, b) => a.path.localeCompare(b.path)); + return { additions, deletions }; } From 2a4c9c0f1f2a32640d43c5d393a2a73a7c3ddb29 Mon Sep 17 00:00:00 2001 From: bluwy Date: Sat, 13 Jun 2026 09:18:15 +0800 Subject: [PATCH 2/5] Update --- src/git.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git.ts b/src/git.ts index bf78ff5..55f2d47 100644 --- a/src/git.ts +++ b/src/git.ts @@ -149,8 +149,8 @@ export async function getFileChanges( }, }); - additions.sort((a, b) => a.path.localeCompare(b.path)); - deletions.sort((a, b) => a.path.localeCompare(b.path)); + additions.sort((a, b) => (a.path > b.path ? 1 : -1)); + deletions.sort((a, b) => (a.path > b.path ? 1 : -1)); return { additions, deletions }; } From fdaf0f08b3e6444f756e40d0b074354db5389d43 Mon Sep 17 00:00:00 2001 From: bluwy Date: Sat, 13 Jun 2026 09:44:49 +0800 Subject: [PATCH 3/5] Change tag --- tests/integration/node.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/node.test.ts b/tests/integration/node.test.ts index dedd5c7..aa38a10 100644 --- a/tests/integration/node.test.ts +++ b/tests/integration/node.test.ts @@ -254,7 +254,7 @@ describe("node", () => { ...REPO, branch, base: { - tag: "v1.4.0", + tag: "v2.1.0", }, ...BASIC_FILE_CONTENTS, }); From d627acd1a221eb6298962d88679dcf822a6c9a23 Mon Sep 17 00:00:00 2001 From: bluwy Date: Sun, 14 Jun 2026 20:47:41 +0800 Subject: [PATCH 4/5] Try base through base --- src/git.ts | 7 ++++--- tests/integration/node.test.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/git.ts b/src/git.ts index 55f2d47..f617bc7 100644 --- a/src/git.ts +++ b/src/git.ts @@ -45,15 +45,16 @@ export const commitChangesFromRepo = async ({ return await commitFilesFromBase64({ ...otherArgs, + base: base ?? { commit: oid }, fileChanges: await getFileChanges( workingDirectory, repoRoot, oid, filterFiles, ), - base: { - commit: oid, - }, + // base: { + // commit: oid, + // }, }); }; diff --git a/tests/integration/node.test.ts b/tests/integration/node.test.ts index aa38a10..dedd5c7 100644 --- a/tests/integration/node.test.ts +++ b/tests/integration/node.test.ts @@ -254,7 +254,7 @@ describe("node", () => { ...REPO, branch, base: { - tag: "v2.1.0", + tag: "v1.4.0", }, ...BASIC_FILE_CONTENTS, }); From 07041ab145c3f78e6427baf1f3781bb8cf48fa06 Mon Sep 17 00:00:00 2001 From: bluwy Date: Sun, 14 Jun 2026 20:53:40 +0800 Subject: [PATCH 5/5] Revert --- src/git.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/git.ts b/src/git.ts index f617bc7..55f2d47 100644 --- a/src/git.ts +++ b/src/git.ts @@ -45,16 +45,15 @@ export const commitChangesFromRepo = async ({ return await commitFilesFromBase64({ ...otherArgs, - base: base ?? { commit: oid }, fileChanges: await getFileChanges( workingDirectory, repoRoot, oid, filterFiles, ), - // base: { - // commit: oid, - // }, + base: { + commit: oid, + }, }); };