# git: Fix bug where opening a git blob from historic commit view could fail \(\#44226\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 12dbbdd1d339d6de7be57015f4210127a017f2fe

Requested commit: 12dbbdd1d339d6de7be57015f4210127a017f2fe

Commit: 12dbbdd1d339d6de7be57015f4210127a017f2fe

Tree: 91170a908f1786fad59a92304e9dd78dd71b43fe

Author: Anthony Eid

Committer: GitHub

## Message

```
git: Fix bug where opening a git blob from historic commit view could fail (#44226)

The failure would happen if the current version of the file was open as
an editor. This happened because the git blob and current version of the
buffer would have the same `ProjectPath`.

The fix was adding a new `DiskState::Historic` variant to represent
buffers that are past versions of a file (usually a snapshot from
version control). Historic buffers don't return a `ProjectPath` because
the file isn't real, thus there isn't and shouldn't be a `ProjectPath`
to it. (At least with the current way we represent a project path)

I also change the display name to use the local OS's path style instead
of being hardcoded to Posix, and cleaned up some code too.

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: xipengjin <jinxp18@gmail.com>
```

## Parents

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

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