Don't gratuitously clobber quickfix in :Ggrep

This commit is contained in:
Tim Pope 2014-06-19 16:40:26 -04:00
parent 2b05b275f5
commit 99809a021c

View File

@ -1070,14 +1070,16 @@ function! s:Grep(cmd,bang,arg) abort
if bufname(entry.bufnr) =~ ':'
let entry.filename = s:repo().translate(bufname(entry.bufnr))
unlet! entry.bufnr
let changed = 1
elseif a:arg =~# '\%(^\| \)--cached\>'
let entry.filename = s:repo().translate(':0:'.bufname(entry.bufnr))
unlet! entry.bufnr
let changed = 1
endif
endfor
if a:cmd =~# '^l'
if a:cmd =~# '^l' && exists('changed')
call setloclist(0, list, 'r')
else
elseif exists('changed')
call setqflist(list, 'r')
endif
if !a:bang && !empty(list)