From 8ecc9b9e11bd341cd9d009e0ac0d083921fae419 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 20 Mar 2012 08:10:46 -0400 Subject: [PATCH] Guard against invalid symlinks in detection Closes #171. --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index a6d8270..12839fd 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -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]