From caee67c7483e6d958595f7c38e925a4542b57c99 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 2 Aug 2018 18:17:54 -0400 Subject: [PATCH] Fix query operations in bare repositories --- autoload/fugitive.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 7c78a9d..c3c39c2 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -175,7 +175,7 @@ function! s:TreeChomp(...) abort let tree = s:Tree(dir) let pre = '' if empty(tree) - let args = ['--git-dir=' . dir] . args + let args = ['--git-dir=' . dir] + args elseif s:cpath(tree) !=# s:cpath(getcwd()) if fugitive#GitVersion() =~# '^[01]\.' let pre = 'cd ' . s:shellesc(tree) . (s:winshell() ? ' & ' : '; ') @@ -970,8 +970,10 @@ function! fugitive#PathComplete(base, ...) abort endif call s:Uniq(matches) call map(matches, "'.git/' . v:val") - else + elseif len(tree) > 1 let matches = s:GlobComplete(tree, s:gsub(base, '/', '*&').'*') + else + let matches = [] endif call map(matches, 's:fnameescape(s:Slash(matchstr(a:base, strip) . v:val))') return matches