From 57af9b98cffbb5030b93eab8c26cb19f7f1f2ea6 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot and Sid Nair Date: Sat, 7 Jul 2012 13:45:52 -0400 Subject: [PATCH] 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. --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index a03cfb8..cb4f2ae 100644 --- 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'