# Worktree paths in git panel, take 2 \(\#26047\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 1763dd714beee0b329dce50a2fc0ce35b17b69f4

Requested commit: 1763dd714beee0b329dce50a2fc0ce35b17b69f4

Commit: 1763dd714beee0b329dce50a2fc0ce35b17b69f4

Tree: 6d2b738fc1020241380da89f162299ccfdf9e117

Author: Cole Miller

Committer: GitHub

## Message

```
Worktree paths in git panel, take 2 (#26047)

Modified version of #25950. We still use worktree paths, but repo paths
with a status that lie outside the worktree are not excluded; instead,
we relativize them by adding `..`. This makes the list in the git panel
match what you'd get from running `git status` (with the repo's worktree
root as the working directory).

- [x] Implement + test new unrelativization logic
- [x] ~~When collecting repositories, dedup by .git abs path, so
worktrees can share a repo at the project level~~ dedup repos at the
repository selector layer, with repos coming from larger worktrees being
preferred
- [x] Open single-file worktree with diff when activating a path not in
the worktree

Release Notes:

- N/A
```

## Parents

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

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