fix(sync): treat non-fast-forwardable branches as warnings#291
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git pull --ff-onlyfails during sync (branch diverged from upstream), treat it as a soft "diverged" warning instead of a hard failure that aborts the entire sync--rebasephase to proceed and bring diverged branches up to date, which is the whole point of passing--rebase⊘ divergedin both sequential and TUI modesFixes #291
Test plan
mise run fmt— no changesmise run clippy— zero warningsmise run test:unit— all passtest_sync_diverged_branch_with_rebase— diverged branch +--rebasesucceeds and rebasestest_sync_diverged_branch_no_rebase— diverged branch without--rebasesucceeds (warning only)🤖 Generated with Claude Code