Guard against invalid symlinks in detection

Closes #171.
This commit is contained in:
Tim Pope
2012-03-20 08:10:46 -04:00
parent 165923ebaf
commit 8ecc9b9e11

View File

@@ -117,7 +117,7 @@ function! fugitive#extract_git_dir(path) abort
return dir
elseif type ==# 'link' && fugitive#is_git_dir(dir)
return resolve(dir)
elseif type !=# ''
elseif type !=# '' && filereadable(dir)
let line = readfile(dir, 1)[0]
if line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1])
return line[8:-1]