Update escaping for dynamic :Git invocations
This commit is contained in:
parent
a025157c5f
commit
fdb57922a4
@ -2570,12 +2570,12 @@ function! s:StageDiffEdit() abort
|
|||||||
let info = s:StageInfo(line('.'))
|
let info = s:StageInfo(line('.'))
|
||||||
let arg = (empty(info.paths) ? s:Tree() : info.paths[0])
|
let arg = (empty(info.paths) ? s:Tree() : info.paths[0])
|
||||||
if info.section ==# 'Staged'
|
if info.section ==# 'Staged'
|
||||||
return 'Git! diff --no-ext-diff --cached '.s:shellesc(arg)
|
return 'Git! diff --no-ext-diff --cached '.s:fnameescape(arg)
|
||||||
elseif info.status ==# '?'
|
elseif info.status ==# '?'
|
||||||
call s:TreeChomp('add', '--intent-to-add', '--', arg)
|
call s:TreeChomp('add', '--intent-to-add', '--', arg)
|
||||||
return s:ReloadStatus()
|
return s:ReloadStatus()
|
||||||
else
|
else
|
||||||
return 'Git! diff --no-ext-diff '.s:shellesc(arg)
|
return 'Git! diff --no-ext-diff '.s:fnameescape(arg)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -2793,10 +2793,10 @@ function! s:StagePatch(lnum1,lnum2) abort
|
|||||||
endfor
|
endfor
|
||||||
try
|
try
|
||||||
if !empty(add)
|
if !empty(add)
|
||||||
execute "Git add --patch -- ".join(map(add,'s:shellesc(v:val)'))
|
execute "Git add --patch -- ".join(map(add,'s:fnameescape(v:val)'))
|
||||||
endif
|
endif
|
||||||
if !empty(reset)
|
if !empty(reset)
|
||||||
execute "Git reset --patch -- ".join(map(reset,'s:shellesc(v:val)'))
|
execute "Git reset --patch -- ".join(map(reset,'s:fnameescape(v:val)'))
|
||||||
endif
|
endif
|
||||||
catch /^fugitive:/
|
catch /^fugitive:/
|
||||||
return 'echoerr ' . string(v:exception)
|
return 'echoerr ' . string(v:exception)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user