Remove unnecessary shell redirection.

While it is aesthetically nicer to discard the unused output from `git
ls-files`, it isn't necessary.  Discarding requires a shell redirection
which exposes us to vim's shell quirks; it's not worth it.
This commit is contained in:
Andy Stewart
2014-01-29 10:57:20 +01:00
parent f158fee95e
commit c7af455c95
2 changed files with 1 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
function! diff#run_diff(realtime, use_external_grep)
let cmd = 'git ls-files --error-unmatch' . utility#discard_stdout_and_stderr() . ' ' . shellescape(utility#file()) . ' && ('
let cmd = 'git ls-files --error-unmatch ' . shellescape(utility#file()) . ' && ('
if a:realtime
let blob_name = ':./' . fnamemodify(utility#file(),':t')

View File

@@ -59,17 +59,6 @@ function! utility#escape(str)
endif
endfunction
function! utility#discard_stdout_and_stderr()
if !exists('utility#discard')
if &shellredir ==? '>%s 2>&1'
let utility#discard = ' > /dev/null 2>&1'
else
let utility#discard = ' >& /dev/null'
endif
endif
return utility#discard
endfunction
function! utility#command_in_directory_of_file(cmd)
let utility#cmd_in_dir = 'cd ' . utility#directory_of_file() . ' && ' . a:cmd
return substitute(utility#cmd_in_dir, "'", '"', 'g')