# sidebar: Fallback to main git worktree path when opening thread in deleted git worktree \(\#53899\) · gitcafe/zed

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

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

Visibility: public

Requested revision: eed33ab2837274997424c6e3e7fa61e15748494e

Requested commit: eed33ab2837274997424c6e3e7fa61e15748494e

Commit: eed33ab2837274997424c6e3e7fa61e15748494e

Tree: 9a4fffc67bed3b1922b65f04a7f6f9a5fa91ed2f

Author: Anthony Eid

Committer: GitHub

## Message

```
sidebar: Fallback to main git worktree path when opening thread in deleted git worktree (#53899)

### Summary

This PR is the first step in improving Zed's error handling when a user
opens an old thread that's associated with a deleted git worktree.
Before, the thread would open in an empty project with a broken state.
This PR instead opens the thread in the workspace associated with the
thread’s main git worktree when available.

### Follow ups

1. Implement remote support for this fallback 
2. Update `ThreadMetadataStore` database to set paths from deleted
worktree to the main worktree
3. If the main git worktree is deleted as well, fallback to the
currently active workspace

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A
```

## Parents

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

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