From d28b1e7cf4478c28dcdbf9caa87dfb5d75a54383 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 24 Jan 2010 22:59:42 -0500 Subject: [PATCH] Work around git-branch-info.vim stupidity --- plugin/fugitive.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 259e979..ba0d087 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -101,6 +101,9 @@ function! s:ExtractGitDir(path) abort endfunction function! s:Detect() + if exists('b:git_dir') && b:git_dir ==# '' + unlet b:git_dir + endif if !exists('b:git_dir') let dir = s:ExtractGitDir(expand('%:p')) if dir != '' @@ -131,7 +134,7 @@ let s:repo_prototype = {} let s:repos = {} function! s:repo(...) abort - let dir = a:0 ? a:1 : (exists('b:git_dir') ? b:git_dir : s:ExtractGitDir(expand('%:p'))) + let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : s:ExtractGitDir(expand('%:p'))) if dir !=# '' if has_key(s:repos,dir) let repo = get(s:repos,dir)