Skip to content

New worktree hangs at "Preparing worktree" when the branch already existsΒ #657

Description

@juicyjusung

First off β€” herdr is a really great project and I've been enjoying using it a lot. Thanks for building and sharing it! πŸ™ Small bug below.

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.

Current behavior

Creating a New worktree with a branch name that already exists hangs forever at "Preparing worktree (new branch 'X')". The dialog never closes and no worktree opens. Under the hood git worktree add -b <branch> <path> exits 255 with fatal: a branch named '<branch>' already exists, but herdr only renders git's first stderr line ("Preparing worktree...") and never surfaces the fatal line. Server log truncates identically: WARN herdr::app::worktrees: git worktree add failed error=Preparing worktree (new branch 'X').

Expected behavior

Surface git's full stderr and fail the dialog gracefully (or offer to check out the existing branch instead of creating it with -b). It should not hang.

Reproduction

  1. In a repo, create a branch: git branch foo
  2. In herdr, open New worktree, enter branch name foo, create and open.
  3. Dialog hangs at "Preparing worktree (new branch 'foo')" indefinitely.

Impact

New worktree creation silently dead-ends with no error shown. Re-attempting the same name keeps hanging; only fix is dropping the leftover branch from a CLI outside herdr. Easy to hit since a prior failed/removed worktree leaves its branch behind.

Environment

  • Herdr version: 0.7.0
  • Update channel (stable or preview): stable (homebrew)
  • Operating system: macOS (Darwin 25.5.0)
  • Terminal: Ghostty
  • Shell, if relevant: zsh
  • Relevant config, if any: [worktrees] directory = ".worktrees"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions