-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
find_git_root doesn't work for submodules #164
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
Seemingly it's not easy to find the git root manually, even though that could be much faster than using the system call. If so, I think we should just stick to |
Please see this branch fixes this issue, @gitbugr . I borrowed the strategy of vim-rooter, hoping that's robust enough, at least for the submodule case :(. |
* Fix git submodule detection Close #164 * Split out path.vim * Fix CI * Update CHANGELOG.md
* first draft of the delmonicos review * finalise the delmonicos evaluation post discussion
Environment (please complete the following information):
Describe the bug
for git submodules, the
.git/
folder is actually a file.To Reproduce
Steps to reproduce the behavior:
Use any vim-clap configuration.
Create a git project
git --init
Pull in your git submodule
git submodule add https://github.com/liuchengxu/vim-clap
Pull in another git submodule
git submodule add https://github.com/liuchengxu/vim-which-key
cd into the submodule you want to work on
cd vim-clap
Open vim and search for a file
Clap files
- you will notice files from your other submoduleCheck the git root
echo clap#util#find_git_root(g:clap.start.bufnr)
- the root is the parent repo. This is wrong.Expected behavior
The git root should point to your submodule.
To fix this temporarily, I replaced the usages of
clap#util#find_git_root(g:clap.start.bufnr)
in autoload/clap/rooter.vim with the oldclap#util#get_git_root()
The text was updated successfully, but these errors were encountered: