Fix query operations in bare repositories

This commit is contained in:
Tim Pope
2018-08-02 18:17:54 -04:00
parent 1fea1e5821
commit caee67c748

View File

@@ -175,7 +175,7 @@ function! s:TreeChomp(...) abort
let tree = s:Tree(dir) let tree = s:Tree(dir)
let pre = '' let pre = ''
if empty(tree) if empty(tree)
let args = ['--git-dir=' . dir] . args let args = ['--git-dir=' . dir] + args
elseif s:cpath(tree) !=# s:cpath(getcwd()) elseif s:cpath(tree) !=# s:cpath(getcwd())
if fugitive#GitVersion() =~# '^[01]\.' if fugitive#GitVersion() =~# '^[01]\.'
let pre = 'cd ' . s:shellesc(tree) . (s:winshell() ? ' & ' : '; ') let pre = 'cd ' . s:shellesc(tree) . (s:winshell() ? ' & ' : '; ')
@@ -970,8 +970,10 @@ function! fugitive#PathComplete(base, ...) abort
endif endif
call s:Uniq(matches) call s:Uniq(matches)
call map(matches, "'.git/' . v:val") call map(matches, "'.git/' . v:val")
else elseif len(tree) > 1
let matches = s:GlobComplete(tree, s:gsub(base, '/', '*&').'*') let matches = s:GlobComplete(tree, s:gsub(base, '/', '*&').'*')
else
let matches = []
endif endif
call map(matches, 's:fnameescape(s:Slash(matchstr(a:base, strip) . v:val))') call map(matches, 's:fnameescape(s:Slash(matchstr(a:base, strip) . v:val))')
return matches return matches