Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/release-policy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down