# Use correct worktree when getting permalink to line \(\#8888\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2b8b913b6b0008f47145f5652b91515d81e32887

Requested commit: 2b8b913b6b0008f47145f5652b91515d81e32887

Commit: 2b8b913b6b0008f47145f5652b91515d81e32887

Tree: bde6259802b68cfe1fbfc2284023b62ca1606813

Author: Thorsten Ball

Committer: GitHub

## Message

```
Use correct worktree when getting permalink to line (#8888)

Previously this code would call `project.visible_worktrees(cx).next`
which might not necessarily return the worktree matching the currently
open file.

What this change does is it adds `get_repo` method on `Project` that
allows us to get the `GitRepository` for the current buffer.

Release Notes:

- Fixed `open permalink to line` not working when multiple folders are
added to the project.

Co-authored-by: Mikayla <mikayla@zed.dev>
```

## Parents

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

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