Permalink
Browse files

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.
  • Loading branch information...
1 parent 3b27827 commit 57af9b98cffbb5030b93eab8c26cb19f7f1f2ea6 Nicolas Viennot and Sid Nair committed with Jul 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 plugin/fugitive.vim
View
2 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'

0 comments on commit 57af9b9

Please sign in to comment.