Fail silently retrieving work tree for blank git dir

Closes https://github.com/tpope/vim-fugitive/issues/1113
This commit is contained in:
Tim Pope 2018-10-17 23:20:11 -04:00
parent 7fae98f263
commit 2845e6dc4f

View File

@ -104,6 +104,8 @@ function! FugitiveTreeForGitDir(path) abort
let dir = a:path
if dir =~# '/\.git$'
return len(dir) ==# 5 ? '/' : dir[0:-6]
elseif dir ==# ''
return ''
endif
if !has_key(s:worktree_for_dir, dir)
let s:worktree_for_dir[dir] = ''