fix(push): stop merge-commit BFS at nearest already-remote ancestor
When pushing a merge commit, branch_have previously contained only the target branch's remote HEAD. The BFS in walk_commits followed parent2's chain with no stop anchor, walking the merged branch's entire history and sending thousands of already-remote commits to the server.
Fix: when the local HEAD is a merge commit, append all known remote branch heads to branch_have. The BFS then stops at the nearest already-remote commit on parent2's chain — sending only the merge commit plus the N new commits between the remote's stale branch tip and parent2, not the full ancestry.
Using all remote heads is safe for merge commits: parent1 is the target branch's remote HEAD (one direct hop), so there is no intermediate branch between remote_head and local_head to trigger the fast-forward verification problem on parent1's chain.
Adds three regression tests covering: - merge where both branch HEADs are exact remote heads (sends 1 commit) - merge where merged branch is N commits ahead of remote (sends N+1) - merge push exits 0 (smoke)
0 comments
muse hub commit comment sha256:02b055a39cb0a0976db28c18a8372bf12b43303cdb8711cf38236d8af0b799b2 --body "your comment"
No comments yet. Be the first to start the discussion.