# git: Suppress blame errors outside Git repositories \(\#56348\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5b948e5aaba15cf4446cfdf9cef1cfddcb062bee

Requested commit: 5b948e5aaba15cf4446cfdf9cef1cfddcb062bee

Commit: 5b948e5aaba15cf4446cfdf9cef1cfddcb062bee

Tree: bf9f68aacf25b9948dff126992f41790377297fd

Author: liam

Committer: GitHub

## Message

```
git: Suppress blame errors outside Git repositories (#56348)

Resolves https://github.com/zed-industries/zed/issues/55552

Git blame can be initialized for buffers that are not backed by any Git
repository. Previously, that path still called into
`Project::blame_buffer`, which returned an error because there was no
repository for the buffer. When blame was user-triggered, that error was
surfaced as a toast even though this is an expected “not applicable”
state rather than a failed Git operation.

This diff checks whether the buffer belongs to a repository before
requesting blame data. Buffers outside Git repositories now produce no
blame entries without emitting an error, while real blame failures
inside repositories continue to use the existing error notification
path.

Release Notes:
- Improved Git blame to quietly ignore files that are not part of a Git
repository.

Co-authored-by: Cole Miller <cole@zed.dev>
```

## Parents

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

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