# git: Use fast access check for repository in git panel \(\#59514\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e4f6742a996e2c79a994ee2687151572334e3d9b

Requested commit: e4f6742a996e2c79a994ee2687151572334e3d9b

Commit: e4f6742a996e2c79a994ee2687151572334e3d9b

Tree: d27bb998a0bc32c624e12c33050f5622305a8a1c

Author: Lukas Geiger

Committer: GitHub

## Message

```
git: Use fast access check for repository in git panel (#59514)

# Objective

The git panel currently runs a full `git status` for checking whether
`git` has access to the repository. This was introduced in #43693 and
currently runs on every file save which is problematic for large repos
where `git status` runs a lot of computation.

## Solution

This PR switches to a simple `git rev-parse` command which is cheap and
achieves the same goal.

## Testing

I added a unittest.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

/cc @dinocosta

Release Notes:

- Improve performance of git access checks in git panel
```

## Parents

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

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