From 0717396aa2a5679b773462b09f4906cac46859fd Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 17 Jul 2018 01:13:47 -0400 Subject: [PATCH] Avoid some redundant --git-dir arguments --- autoload/fugitive.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 3925846..67560eb 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1228,7 +1228,7 @@ function! s:Commit(mods, args, ...) abort else let command = 'env GIT_EDITOR=false ' endif - let command .= repo.git_command('commit').' '.a:args + let command .= s:git_command() . ' commit ' . a:args if &shell =~# 'csh' noautocmd silent execute '!('.command.' > '.outfile.') >& '.errorfile elseif a:args =~# '\%(^\| \)-\%(-interactive\|p\|-patch\)\>' @@ -1465,7 +1465,7 @@ function! s:Grep(cmd,bang,arg) abort let dir = getcwd() try execute cd s:fnameescape(s:repo().tree()) - let &grepprg = s:repo().git_command('--no-pager', 'grep', '-n', '--no-color') + let &grepprg = s:git_command() . ' --no-pager grep -n --no-color' let &grepformat = '%f:%l:%m,%m %f match%ts,%f' exe a:cmd.'! '.escape(matchstr(a:arg,'\v\C.{-}%($|[''" ]\@=\|)@='),'|') let list = a:cmd =~# '^l' ? getloclist(0) : getqflist() @@ -1525,7 +1525,7 @@ function! s:Log(cmd, line1, line2, ...) abort let dir = getcwd() try execute cd s:fnameescape(s:repo().tree()) - let &grepprg = escape(call(s:repo().git_command,cmd,s:repo()),'%#') + let &grepprg = escape(s:git_command() + join(map(cmd, '" ".s:shellesc(v:val)'), ''), '%#') let &grepformat = '%Cdiff %.%#,%C--- %.%#,%C+++ %.%#,%Z@@ -%\d%\+\,%\d%\+ +%l\,%\d%\+ @@,%-G-%.%#,%-G+%.%#,%-G %.%#,%A%f::%m,%-G%.%#' exe a:cmd finally @@ -1576,7 +1576,7 @@ function! s:Edit(cmd, bang, mods, ...) abort let arglist = map(copy(a:000), 's:gsub(v:val, ''\\@