pub fn sync_default_branch(
root: &Path,
default: &str,
warnings: &mut Vec<String>,
) -> boolExpand description
Bring local default branch into sync with origin/<default> without ever pushing.
State matrix — each row documents why the mapped action is correct:
Equal → no-op. Local and origin are identical; nothing to do.
Behind → git merge --ff-only origin/<default> in the main worktree.
The main worktree is always checked out on
Ahead → Print one info line so the user knows local has unpushed commits.
No network call, no ref changes. Explicit pushes happen via
apm state <id> implemented — apm sync NEVER pushes anything.
Diverged → Print guidance (rebase/merge/push steps). No ref changes. The dirty-aware variant is printed when the main worktree is unclean.
NoRemote → Silent skip. No origin is configured, or origin/<default> could
not be resolved (e.g. fetch hasn’t run yet). Fetch failures are
already surfaced as a warning by the existing fetch path in sync.rs.