commit 57af9b98cffbb5030b93eab8c26cb19f7f1f2ea6 (tree)
parent 3b278277e0b46711c30a3d1a0083e527b2fb98ed
Author: Nicolas Viennot and Sid Nair <nviennot+sidnair@viennot.biz>
Date: Sat, 7 Jul 2012 13:45:52 -0400
Follow symlinks
Previously, symlinks were not resolved. Thus, symlinks outside a git
directory would have no git dir even if they linked to a file in a git
directory.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -108,7 +108,7 @@ function! fugitive#extract_git_dir(path) abort
if s:shellslash(a:path) =~# '^fugitive://.*//'
return matchstr(s:shellslash(a:path), '\C^fugitive://\zs.\{-\}\ze//')
endif
- let root = s:shellslash(simplify(fnamemodify(a:path, ':p:s?[\/]$??')))
+ let root = s:shellslash(simplify(fnamemodify(resolve(a:path), ':p:s?[\/]$??')))
let previous = ""
while root !=# previous
let dir = s:sub(root, '[\/]$', '') . '/.git'