# git: Don't consider $HOME as containing git repository unless it's opened directly \(\#25948\) · gitcafe/zed

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

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

Visibility: public

Requested revision: dc3158c8ce1385fe8c71ff83aba9082387f482fa

Requested commit: dc3158c8ce1385fe8c71ff83aba9082387f482fa

Commit: dc3158c8ce1385fe8c71ff83aba9082387f482fa

Tree: 061975e02816f3ed6961bd53352d680065c63bc6

Author: Cole Miller

Committer: GitHub

## Message

```
git: Don't consider $HOME as containing git repository unless it's opened directly (#25948)

When a worktree is created, we walk up the ancestors of the root path
trying to find a git repository. In particular, if your `$HOME` is a git
repository and you open some subdirectory of `$HOME` that's *not* a git
repository, we end up scanning `$HOME` and everything under it looking
for changed and untracked files, which is often pretty slow. Consistency
here is not very useful and leads to a bad experience.

This PR adds a special case to not consider `$HOME` as a containing git
repository, unless you ask for it by doing the equivalent of `zed ~`.

Release Notes:

- Changed the behavior of git features to not treat `$HOME` as a git
repository unless opened directly
```

## Parents

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

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