Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix git repo detection on symlinks #11732

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

dead10ck
Copy link
Member

Currently, if a symlink is opened which points to a file inside a git repo, the git repo is not detected, so there is no diff gutter. This was done because if we used the content of a symlink git object, whose content is a file path, that literal file path would be used as the content of the diff base, producing a diff gutter in the UI that was all additions.

On the other hand, because of this, the git diff gutter doesn't work at all on symlinks.

We work around both of these problems by resolving symlinks before finding the path's git repo.

Currently, if a symlink is opened which points to a file inside a git
repo, the git repo is not detected, so there is no diff gutter. This
was done because if we used the content of a symlink git object, whose
content is a file path, that literal file path would be used as the
content of the diff base, producing a diff gutter in the UI that was
all additions.

On the other hand, because of this, the git diff gutter doesn't work at
all on symlinks.

We work around both of these problems by resolving symlinks before
finding the path's git repo.
@the-mikedavis the-mikedavis added the A-vcs Area: Version control system interaction label Sep 21, 2024
@the-mikedavis the-mikedavis merged commit 02b6f14 into helix-editor:master Oct 3, 2024
6 checks passed
plul pushed a commit to plul/helix that referenced this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vcs Area: Version control system interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants