Skip to content

fix: add --base flag to swarm merge for repos without develop branch#539

Merged
dollspace-gay merged 1 commit intodevelopfrom
fix/swarm-merge-base-branch
Mar 30, 2026
Merged

fix: add --base flag to swarm merge for repos without develop branch#539
dollspace-gay merged 1 commit intodevelopfrom
fix/swarm-merge-base-branch

Conversation

@dollspace-gay
Copy link
Copy Markdown

Summary

  • Adds --base <ref> flag to crosslink swarm merge (auto-detects develop/main/origin/develop/origin/main by default)
  • Fixes hardcoded "develop" in branch creation and diff generation that caused fatal: 'develop' is not a commit on repos using main
  • Extracts detect_base_branch() helper and refactors discover_worktrees and extract_diff_ranges to use it, eliminating duplicated base-ref iteration

Closes #518

Test plan

  • cargo build passes
  • cargo clippy -- -D warnings -W clippy::unwrap_used -W clippy::expect_used clean (1.94.0)
  • 1682 lib tests + 186 CLI integration tests pass

🤖 Generated with Claude Code

swarm merge hardcoded "develop" as the base for branch creation and
diff generation, failing with "fatal: 'develop' is not a commit" on
repos that use main as their default branch.

Adds --base flag (auto-detects develop/main/origin variants by default).
Extracts detect_base_branch() helper and refactors discover_worktrees
and extract_diff_ranges to use it, eliminating duplicated base-ref
iteration logic.

Closes #518

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dollspace-gay dollspace-gay self-assigned this Mar 30, 2026
@dollspace-gay dollspace-gay merged commit 4dc1624 into develop Mar 30, 2026
6 checks passed
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