# worktrees: reject refs/heads and @\{ branch names on create \(\#146\) · lucenx/signaltty

[View on GitCafe](https://git.cafe/lucenx/signaltty/commit/1d60fec13c07fdfd033c2724ba7b02118b91aa87)

Repository: [lucenx/signaltty](https://git.cafe/lucenx/signaltty)

Visibility: public

Requested revision: 1d60fec13c07fdfd033c2724ba7b02118b91aa87

Requested commit: 1d60fec13c07fdfd033c2724ba7b02118b91aa87

Commit: 1d60fec13c07fdfd033c2724ba7b02118b91aa87

Tree: 2a05d23d8a4480e847b0d4ccfb45681a0d273a95

Author: Simone

Committer: GitHub

## Message

```
worktrees: reject refs/heads and @{ branch names on create (#146)

worktree.create only ran git check-ref-format --branch, which still
accepts refs/heads/foo and @{-1}. The former creates nested
refs/heads/refs/heads/...; the latter expands to another branch.
Reuse validate_branch_name (same rules as task.start) so prefs/theme
stays valid while those traps are refused.

Opened by TtyPatch

Co-authored-by: Grok Bot <grok-bot@x.ai>
```

## Parents

- [1862dd4ff75a3aa3578cacb7b74459ca3a2bec1f](https://git.cafe/lucenx/signaltty/commit/1862dd4ff75a3aa3578cacb7b74459ca3a2bec1f?format=markdown)

[Source at this commit](https://git.cafe/lucenx/signaltty/tree/1d60fec13c07fdfd033c2724ba7b02118b91aa87?format=markdown)
