Fix opening repos when .git
is a soft link
#21153
Open
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #ISSUE
background
If a project is big, some times it will be splited into many small git repos.
google repo is a tool to manage a group of git repos.
But, any small git repo manged by this tool, have a difference with normal git repo.
That is , the path
.git
in the root of the git repo, is not a normal directory, but a soft link to real git bare dir.zed can not recognize the
git-repo
managed git reposyou can use the procedure to genreate this problem
with vscode, after opening this project, git works well.
but for Zed, git not work(not git status, no git blame)
how to fix
libgit2 can recognize git repo from the root of the project(dir that have
.git
).so, we can recognize the git project by opening from the project root dir, but not the
.git
dirThis fix also works with normal git project.
before fix
after fix
Release Notes:
.git
is soft link