rhysd / git-messenger.vim

Vim and Neovim plugin to reveal the commit messages under the cursor
MIT License
1.34k stars 32 forks source link

Does not resolve symlink before searching for git root #81

Closed bew closed 2 years ago

bew commented 2 years ago

For example, I have my dotfiles repo in ~/.dot and my git config is a symlink from ~/.gitconfig to ~/.dot/gitconfig

When I edit ~/.gitconfig (using the symlink, while I'm not in my dotfiles repo), invoking git-messenger leads to: git-messenger: Directory '/home/my-user' is not inside a Git repository

The culprit seems to be here: https://github.com/rhysd/git-messenger.vim/blob/dd3e54ae43da0baad33e134f811434b061d45068/autoload/gitmessenger/blame.vim#L489-L490

I think that calling resolve(a:file) before giving it to fnamemodify should do the trick.