# project: Fix spurious git diff for symlinked files \(\#58655\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 0ee1a808bcd61931356470dd039bf0457e27dc0e

Requested commit: 0ee1a808bcd61931356470dd039bf0457e27dc0e

Commit: 0ee1a808bcd61931356470dd039bf0457e27dc0e

Tree: 60e597812acafe11c54253c3bd8125444fe63dfd

Author: Smit Barmase

Committer: GitHub

## Message

```
project: Fix spurious git diff for symlinked files (#58655)

Opening a symlinked file showed the whole file as changed in the git
gutter/diff. Git stores only the symlink's target path as that entry's
blob, while the buffer holds the resolved target's contents, so diffing
the two is meaningless.

We now skip loading a git diff base whenever a buffer's worktree entry
is a symlink i.e. its `canonical_path` is set.

Release Notes:

- Fixed symlinked files showing the entire file as changed in the git
diff/gutter.
```

## Parents

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

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