You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Merge auto-syncs a behind local default branch instead of refusing #791
assertDefaultNotBehindOrigin (electron/worktrees.js, #770) hard-refuses every Git-tab Merge once local main is behind origin/main. The squash-landing workflow (leftover worktrees land on origin via a squash from another checkout, e.g. #784) leaves local main BOTH ahead (duplicate commits) and behind permanently, so the refusal fires on every merge until someone hand-fixes the checkout. Meanwhile new worktrees keep forking from the stale base, re-shipping already-fixed bugs.
Fix
Replace the refusal with a tiered auto-sync in the checkout that holds the default branch:
probe conflicts → keep refusing, but name the likely cause (local commits already squash-landed upstream) and the remedy (backup branch + reset --hard origin/<branch>).
Never sync into a dirty checkout: tracked modifications fall back to the refusal.
Implemented on branch coder/fork-fork-i-got-this-feedback-i-got-this-a6b98b: assertDefaultNotBehindOrigin became syncDefaultWithOrigin (electron/worktrees.js). Behind-only fast-forwards; diverged auto-merges when merge-tree --write-tree proves it clean; dirty checkout or conflicts still refuse, now with the backup-branch + reset --hard remedy in the message. 4 new tests in electron/test/worktrees.test.js replace the old #770 refusal test; suite 63/63. The live blockage that motivated this is also cleared: /Users/willem/code/coder-release-build main was reset to origin/main (backup branch backup-diverged-69c6cb2) after verifying its 18 ahead commits were all content-landed via the 9866118 squash.
Shipped. electron/worktrees.js syncDefaultWithOrigin replaced the old refuse-when-behind gate: behind-only fast-forwards; diverged auto-merges only when merge-tree is clean; dirty checkout or conflicts still refuse.
Activity
currentbits commentedon Aug 29, 2026
Implemented on branch coder/fork-fork-i-got-this-feedback-i-got-this-a6b98b: assertDefaultNotBehindOrigin became syncDefaultWithOrigin (electron/worktrees.js). Behind-only fast-forwards; diverged auto-merges when merge-tree --write-tree proves it clean; dirty checkout or conflicts still refuse, now with the backup-branch + reset --hard remedy in the message. 4 new tests in electron/test/worktrees.test.js replace the old #770 refusal test; suite 63/63. The live blockage that motivated this is also cleared: /Users/willem/code/coder-release-build main was reset to origin/main (backup branch backup-diverged-69c6cb2) after verifying its 18 ahead commits were all content-landed via the 9866118 squash.
currentbits commentedon Sep 6, 2026
Shipped. electron/worktrees.js syncDefaultWithOrigin replaced the old refuse-when-behind gate: behind-only fast-forwards; diverged auto-merges only when merge-tree is clean; dirty checkout or conflicts still refuse.