Work around git-branch-info.vim stupidity

This commit is contained in:
Tim Pope 2010-01-24 22:59:42 -05:00
parent 4bbeec5938
commit d28b1e7cf4

View File

@ -101,6 +101,9 @@ function! s:ExtractGitDir(path) abort
endfunction endfunction
function! s:Detect() function! s:Detect()
if exists('b:git_dir') && b:git_dir ==# ''
unlet b:git_dir
endif
if !exists('b:git_dir') if !exists('b:git_dir')
let dir = s:ExtractGitDir(expand('%:p')) let dir = s:ExtractGitDir(expand('%:p'))
if dir != '' if dir != ''
@ -131,7 +134,7 @@ let s:repo_prototype = {}
let s:repos = {} let s:repos = {}
function! s:repo(...) abort 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 dir !=# ''
if has_key(s:repos,dir) if has_key(s:repos,dir)
let repo = get(s:repos,dir) let repo = get(s:repos,dir)