From 2845e6dc4fa33aa1b97435b779b11b4948539f15 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 17 Oct 2018 23:20:11 -0400 Subject: [PATCH] Fail silently retrieving work tree for blank git dir Closes https://github.com/tpope/vim-fugitive/issues/1113 --- plugin/fugitive.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 952c715..56ee113 100644 --- 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] = ''