Skip to content

Cannot create namespaced branches with a slash in the name #61

@seflue

Description

@seflue

Branch creation silently fails as soon as the name contains a /.
The modal closes, the working tree stays where it was, and nothing
shows up in the UI. Plain names like PROJ-1-foo work; namespaced
ones like feature/PROJ-1-foo don't.

Any name with a slash is treated as a remote branch and ends up in
git checkout -b <suffix> --track <full-name>, which fails because
no such remote exists. Stderr is not surfaced, so the failure is
invisible.

This makes namespaced branch templates effectively unusable,
including the {{.ParentKey}}/... patterns from #29.

Proposal

Route to tracking only when the entered name exactly matches an
existing entry from git branch -r. Otherwise create a new local
branch.

Resolution order:

  1. Local branch with that name exists -> git checkout
  2. Exact remote match -> git checkout -b <local> --track <remote>
  3. Otherwise -> git checkout -b <name>

Strict equality, not prefix match: an existing origin/feature/x
must not capture a new origin/feature/y.

I have this implemented and can open a PR.

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