From ccee1f26fc41b1ab46a66decb6a67f18df0b1bd1 Mon Sep 17 00:00:00 2001 From: NiftyAndy Date: Sun, 2 Aug 2026 23:56:31 -0400 Subject: [PATCH] fix(reconcile): classify patch-equivalent trees consistently --- src/lib/release-policy.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/release-policy.mjs b/src/lib/release-policy.mjs index 28c9e74..e37605d 100644 --- a/src/lib/release-policy.mjs +++ b/src/lib/release-policy.mjs @@ -256,6 +256,12 @@ export function classifyReconciliation(input) { if (Array.isArray(directChangedPaths)) { const paths = [...new Set(directChangedPaths.map((path) => path.trim()).filter(Boolean))] const unexpected = unexpectedReleasePaths(paths, allowed) + // Git may hide patch-equivalent commits when divergentCommits uses + // --cherry-pick. If the final trees are identical and no non-equivalent + // commits remain, classify the branches consistently as aligned. + if (!paths.length && !mainOnlyCommits.length && !stagingOnlyCommits.length) { + return { action: 'aligned', targetSha: mainSha, reason: 'Branches have different history but identical content.' } + } const stagingOnlyReleaseOnly = stagingOnlyCommits.length > 0 && stagingOnlyCommits.every((commit) => Array.isArray(commit.changedPaths) && commit.changedPaths.length > 0 && unexpectedReleasePaths(commit.changedPaths, allowed).length === 0, )