# title_bar: Fix worktree label showing \`main\` when opening a worktree directly \(\#54406\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/0858f1c0c485ff117dee1236eb69ca787e5b5b8a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 0858f1c0c485ff117dee1236eb69ca787e5b5b8a

Requested commit: 0858f1c0c485ff117dee1236eb69ca787e5b5b8a

Commit: 0858f1c0c485ff117dee1236eb69ca787e5b5b8a

Tree: ed6652af70e91bb0af88f1db3ea4c1f40fcd9fc0

Author: Danilo Leal

Committer: GitHub

## Message

```
title_bar: Fix worktree label showing `main` when opening a worktree directly (#54406)

This PR fixes an issue where we'd show incorrect worktree labels when
opening a linked worktree directly. The linked worktree name would be
displayed in the project button but the dedicated worktree button would
be displaying "main", which is incorrect.

Now that we have a dedicated worktree button in the title bar, we can
make the project button always show the root repository name,
effectively matching the threads sidebar.

Release Notes:

- Fixed the title bar worktree button showing "main" when opening a
linked git worktree directly.
```

## Parents

- [7c1078e49cb3281352b332039498d74267ab527c](https://git.cafe/gitcafe/zed/commit/7c1078e49cb3281352b332039498d74267ab527c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/0858f1c0c485ff117dee1236eb69ca787e5b5b8a?format=markdown)
