Skip to content

Fallback to origin for missing sync old-base refs#19

Merged
brdv merged 1 commit intomainfrom
sync-old-base-fallback
Feb 11, 2026
Merged

Fallback to origin for missing sync old-base refs#19
brdv merged 1 commit intomainfrom
sync-old-base-fallback

Conversation

@brdv
Copy link
Owner

@brdv brdv commented Feb 11, 2026

Summary

Make sync resilient when a planned old-base branch no longer exists locally by falling back to origin/<branch>.

Changelist

  • src/gitops.rs
    • Added resolve_old_base_for_rebase(base_branch):
      • tries refs/heads/<base> first
      • falls back to refs/remotes/origin/<base>
      • returns actionable error if neither resolves
  • src/cli.rs
    • run_sync now uses resolve_old_base_for_rebase instead of local-head-only resolution.
  • tests/cli_skeleton.rs
    • Extended git stub to simulate missing local refs and custom remote SHAs.
    • Added regression test sync_uses_remote_old_base_when_local_old_base_is_missing.

Validation

  • cargo fmt --all
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features

@brdv brdv merged commit 01cc5fb into main Feb 11, 2026
1 check passed
@brdv brdv deleted the sync-old-base-fallback branch February 11, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant