# git: Do not re-compute git_access for \`\.git/\` changes \(\#60503\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5333ca1af7900d82cb939436ea5b7020ae7f317a

Requested commit: 5333ca1af7900d82cb939436ea5b7020ae7f317a

Commit: 5333ca1af7900d82cb939436ea5b7020ae7f317a

Tree: 7dc82edb231e118fd3beae689303eedb38b08675

Author: Lukas Geiger

Committer: GitHub

## Message

```
git: Do not re-compute git_access for `.git/` changes (#60503)

This builds on #59521 and addresses @dinocosta's comment
https://github.com/zed-industries/zed/pull/59521#pullrequestreview-4563460240

Looking at it again, I think
https://github.com/zed-industries/zed/pull/59521/commits/e7ed02cc4963868632ba97a1fb09f1b398d3b22b
was too conservative. Re-running the access check on every commit,
stage, or checkout, doesn't really make sense. Access depends on `.git`
ownership/permissions and on the global `safe.directory` config.

File writes in `.git/` can actually never change the access. The only
case where this access can change is an external command that changes
the ownership or permission of the folder. That sounds like a quite rare
edge case and I'm not 100% sure whether all file watchers even currently
correctly trigger events for ownership changes. @dinocosta Let me know
what you think.

Release Notes:

- Improved Git Panel performance by avoiding redundant repository access
checks.

Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

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

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