mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 20:13:46 -05:00
Wrap compound commands in parentheses.
This fixes a problem on Windows where non-git-tracked files caused an error in Vim instead of returning normally with a non-zero exit code.
This commit is contained in:
committed by
Andy Stewart
parent
f291db08c7
commit
dff7bc8736
@@ -4,7 +4,8 @@ let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
|
|||||||
|
|
||||||
|
|
||||||
function! diff#run_diff(realtime, use_external_grep)
|
function! diff#run_diff(realtime, use_external_grep)
|
||||||
let cmd = 'git ls-files --error-unmatch ' . utility#shellescape(utility#file()) . ' && ('
|
" Wrap compound command in parentheses to make Windows happy.
|
||||||
|
let cmd = '(git ls-files --error-unmatch ' . utility#shellescape(utility#file()) . ' && ('
|
||||||
|
|
||||||
if a:realtime
|
if a:realtime
|
||||||
let blob_name = ':' . utility#shellescape(utility#file_relative_to_repo_root())
|
let blob_name = ':' . utility#shellescape(utility#file_relative_to_repo_root())
|
||||||
@@ -22,7 +23,7 @@ function! diff#run_diff(realtime, use_external_grep)
|
|||||||
let cmd .= s:grep_command . ' || true'
|
let cmd .= s:grep_command . ' || true'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cmd .= ')'
|
let cmd .= '))'
|
||||||
|
|
||||||
if a:realtime
|
if a:realtime
|
||||||
let diff = system(utility#command_in_directory_of_file(cmd), utility#buffer_contents())
|
let diff = system(utility#command_in_directory_of_file(cmd), utility#buffer_contents())
|
||||||
|
|||||||
Reference in New Issue
Block a user