Skip to content

Resolve the fallback HEAD only for a branch that needs it - #24

Merged
masawada merged 5 commits into
mainfrom
defer-remove-base-head-resolution
Sep 3, 2026
Merged

masawada merged 5 commits into
mainfrom
defer-remove-base-head-resolution

Conversation

@masawada

@masawada masawada commented Sep 3, 2026 •

Copy link
Copy Markdown
Owner

Why

  • eda remove resolved the HEAD of the invoking worktree and of the primary checkout before any removal, even with --force, which judges nothing against a base.
  • When the primary checkout is on an unborn branch (after git switch --orphan), that resolution failed, so a forced removal and a removal judged by a resolvable upstream both failed with "cannot resolve HEAD". The WorktreeRemove hook failed the same way.

What

  • --force skips the base resolution entirely.
  • Otherwise the HEADs are still resolved once when the command starts, but a failure is kept in the base and reported only for a branch that falls back to that HEAD. The hook does the same for the primary HEAD.
  • Tests cover forced and upstream-based removal with an unborn primary HEAD, fallback failures for both the primary and invoking HEADs, multiple branches, forced removal without an invoking worktree, and the hook.

@masawada
masawada force-pushed the defer-remove-base-head-resolution branch from 10fe1ef to 80d13ce Compare September 3, 2026 03:05
@masawada
masawada merged commit e6a3ef7 into main Sep 3, 2026
3 checks passed
@masawada
masawada deleted the defer-remove-base-head-resolution branch September 3, 2026 03:14
@github-actions github-actions Bot mentioned this pull request Sep 3, 2026
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