Skip to content

fix(sync): treat non-fast-forwardable branches as warnings#291

Merged
avihut merged 1 commit intomasterfrom
fix/sync-fails-on-branch-no-ff
Mar 11, 2026
Merged

fix(sync): treat non-fast-forwardable branches as warnings#291
avihut merged 1 commit intomasterfrom
fix/sync-fails-on-branch-no-ff

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Mar 11, 2026

Summary

  • When git pull --ff-only fails during sync (branch diverged from upstream), treat it as a soft "diverged" warning instead of a hard failure that aborts the entire sync
  • This allows the --rebase phase to proceed and bring diverged branches up to date, which is the whole point of passing --rebase
  • Diverged branches show as yellow ⊘ diverged in both sequential and TUI modes

Fixes #291

Test plan

  • mise run fmt — no changes
  • mise run clippy — zero warnings
  • mise run test:unit — all pass
  • New integration test test_sync_diverged_branch_with_rebase — diverged branch + --rebase succeeds and rebases
  • New integration test test_sync_diverged_branch_no_rebase — diverged branch without --rebase succeeds (warning only)
  • All existing sync integration tests still pass

🤖 Generated with Claude Code

When a local branch has diverged from its upstream (e.g., after a rebase
or amend), `git pull --ff-only` fails. Previously this aborted the
entire sync, preventing the rebase phase from running — even when
`--rebase` was explicitly passed with the intent to bring branches up to
date.

Now ff-only failures are detected and treated as a soft "diverged" state
instead of a hard failure. The branch stays at its current commit and
the sync continues, allowing the rebase phase to proceed normally.

Fixes #291

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut added this to the v1.1.0 milestone Mar 11, 2026
@avihut avihut added the fix Bug fix label Mar 11, 2026
@avihut avihut self-assigned this Mar 11, 2026
@avihut avihut merged commit 3b881dc into master Mar 11, 2026
6 checks passed
@avihut avihut deleted the fix/sync-fails-on-branch-no-ff branch March 11, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant