Skip to content

fix: allow --remote delete when local branch does not exist#341

Merged
avihut merged 4 commits intomasterfrom
fix/remove-remote-branch
Mar 27, 2026
Merged

fix: allow --remote delete when local branch does not exist#341
avihut merged 4 commits intomasterfrom
fix/remove-remote-branch

Conversation

@avihut
Copy link
Copy Markdown
Owner

@avihut avihut commented Mar 27, 2026

Summary

  • When daft remove BRANCH --remote is used and the remote branch exists but the local branch doesn't, the remote branch is now correctly deleted
  • Previously, validation always checked for local branch existence first, blocking remote-only deletion
  • Adds resolve_remote_for_missing_local() helper that probes remote refs directly when no local tracking config exists

Fixes #341

Test plan

  • Regression test: remote-only-no-local.yml — remote branch deleted when local branch missing
  • Edge case test: remote-only-nonexistent.yml — clear error when remote branch doesn't exist either
  • Full branch-delete suite (12 scenarios) passes
  • 921 unit tests pass
  • clippy and fmt clean

🤖 Generated with Claude Code

avihut and others added 4 commits March 28, 2026 01:11
When --remote is used, the command should delete the remote branch
even if the local branch doesn't exist. This test currently fails,
demonstrating the bug.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avihut avihut added this to the Public Launch milestone Mar 27, 2026
@avihut avihut added the fix Bug fix label Mar 27, 2026
@avihut avihut self-assigned this Mar 27, 2026
@avihut avihut merged commit f7981df into master Mar 27, 2026
8 checks passed
@avihut avihut deleted the fix/remove-remote-branch branch March 27, 2026 22: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