commit 2845e6dc4fa33aa1b97435b779b11b4948539f15 (tree)
parent 7fae98f2630176a32db6b6e5ed51900f9f3a7a8c
Author: Tim Pope <code@tpope.net>
Date: Wed, 17 Oct 2018 23:20:11 -0400
Fail silently retrieving work tree for blank git dir
Closes https://github.com/tpope/vim-fugitive/issues/1113
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -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] = ''