diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index b20cbda..a026b6c 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -29,7 +29,7 @@ endfunction function! s:shellesc(arg) abort if a:arg =~ '^[A-Za-z0-9_/.-]\+$' return a:arg - elseif &shell =~# 'cmd' + elseif &shell =~# 'cmd' || &shell =~# 'power' return '"'.s:gsub(s:gsub(a:arg, '"', '""'), '\%', '"%"').'"' else return shellescape(a:arg) @@ -951,7 +951,7 @@ function! s:Commit(args) abort try try execute cd.s:fnameescape(s:repo().tree()) - if &shell =~# 'cmd' + if &shell =~# 'cmd' || &shell =~# 'power' let command = '' let old_editor = $GIT_EDITOR let $GIT_EDITOR = 'false' @@ -2037,14 +2037,14 @@ function! s:ReplaceCmd(cmd,...) abort let prefix = '' try if a:0 && a:1 != '' - if &shell =~# 'cmd' + if &shell =~# 'cmd' || &shell =~# 'power' let old_index = $GIT_INDEX_FILE let $GIT_INDEX_FILE = a:1 else let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' ' endif endif - if &shell =~# 'cmd' + if &shell =~# 'cmd' || &shell =~# 'power' let cmd_escape_char = &shellxquote == '(' ? '^' : '^^^' call system('cmd /c "'.prefix.s:gsub(a:cmd,'[<>]', cmd_escape_char.'&').' > '.tmp.'"') else @@ -2191,7 +2191,7 @@ function! s:BufWriteIndexFile() abort endif let info = old_mode.' '.sha1.' '.stage."\t".path call writefile([info],tmp) - if &shell =~# 'cmd' + if &shell =~# 'cmd' || &shell =~# 'power' let error = system('type '.s:gsub(tmp,'/','\\').'|'.s:repo().git_command('update-index','--index-info')) else let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp)