# Fix thread's worktree being discarded upon archiving the previous thread in the sidebar \(\#52271\) · gitcafe/zed

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

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

Visibility: public

Requested revision: cc56071c96a3d4c6b14e72d88d9fd16a79da7be8

Requested commit: cc56071c96a3d4c6b14e72d88d9fd16a79da7be8

Commit: cc56071c96a3d4c6b14e72d88d9fd16a79da7be8

Tree: 4c0f707d74f0188a25501e536cef8d7233c75ede

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix thread's worktree being discarded upon archiving the previous thread in the sidebar (#52271)

This PR fixes a bug where archiving a thread could cause the *next*
thread to be opened in the current workspace, even though it belonged to
a different worktree.

Release Notes:

- N/A
```

## Parents

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

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