Skip to content

[Bug]: Creating a worktree from Linear can fail for an already checked-out Unicode branch on macOS #18447

Description

@domuk-k

Operating system

macOS

Orca version

1.4.196

Details

Short summary:

Creating a worktree from a Linear issue can fail when its generated branch name contains Unicode and a canonically equivalent branch is already checked out in another worktree.

What happened?

The native Create Worktree dialog sometimes invokes git worktree add with a branch that Git considers identical to an already checked-out branch, then fails with:

fatal: 'feature/수신-기반' is already used by worktree at '/path/to/existing-worktree'

The destination path has already been given a numeric suffix, but the branch name has not, so retrying produces the same failure.

How can we reproduce it?

  1. On macOS, use a repository with core.precomposeunicode=true.
  2. Have a local branch containing Hangul checked out in an existing worktree.
  3. In the Orca native app, open the Create Worktree dialog and select a Linear issue whose generated branchName is canonically equivalent to that branch but uses the decomposed Unicode representation.
  4. Create the worktree.

Expected result:

Orca detects that Git resolves the requested name to an already checked-out ref and follows its existing branch-conflict behavior instead of invoking git worktree add with that ref.

Actual result:

Orca treats the decomposed Linear branch name and the precomposed branch returned by git worktree list as different JavaScript strings, attempts to reuse the occupied branch, and Git rejects the command.

Why it appears intermittent:

The first creation and ASCII-only branch names work. The failure requires both an existing checked-out branch and canonically equivalent Unicode names represented differently.

Additional diagnostics:

  • Apple Git 2.50.1
  • core.precomposeunicode=true
  • The Linear-provided branch name reaches worktree creation in NFD form.
  • git worktree list --porcelain reports the checked-out ref in NFC form.
  • git show-ref --verify -- refs/heads/<NFD name> resolves to the actual NFC ref on macOS.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    os:macosIssues affecting macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions