Skip to content
Snippets Groups Projects
Commit 2e2bf2ea authored by Jerome Reybert's avatar Jerome Reybert
Browse files

utoload/git.vim: print error messages with echom

parent 25698b69
Branches
Tags
No related merge requests found
......@@ -171,8 +171,11 @@ function! magit#git#git_add(filename)
let git_cmd=s:git_cmd . " add --no-ignore-removal -- " . a:filename
silent let git_result=magit#utils#system(git_cmd)
if ( v:shell_error != 0 )
echoerr "Git error: " . git_result
echoerr "Git cmd: " . git_cmd
echohl WarningMsg
echom "Git error: " . git_result
echom "Git cmd: " . git_cmd
echohl None
throw 'add error'
endif
endfunction
......@@ -184,8 +187,11 @@ function! magit#git#git_checkout(filename)
let git_cmd=s:git_cmd . " checkout -- " . a:filename
silent let git_result=magit#utils#system(git_cmd)
if ( v:shell_error != 0 )
echoerr "Git error: " . git_result
echoerr "Git cmd: " . git_cmd
echohl WarningMsg
echom "Git error: " . git_result
echom "Git cmd: " . git_cmd
echohl None
throw 'checkout error'
endif
endfunction
......@@ -197,8 +203,11 @@ function! magit#git#git_reset(filename)
let git_cmd=s:git_cmd . " reset HEAD -- " . a:filename
silent let git_result=magit#utils#system(git_cmd)
if ( v:shell_error != 0 )
echoerr "Git error: " . git_result
echoerr "Git cmd: " . git_cmd
echohl WarningMsg
echom "Git error: " . git_result
echom "Git cmd: " . git_cmd
echohl None
throw 'reset error'
endif
endfunction
......@@ -216,10 +225,13 @@ function! magit#git#git_apply(header, selection)
let git_cmd=s:git_cmd . " apply --recount --no-index --cached -"
silent let git_result=magit#utils#system(git_cmd, selection)
if ( v:shell_error != 0 )
echoerr "Git error: " . git_result
echoerr "Git cmd: " . git_cmd
echoerr "Tried to aply this"
echoerr string(selection)
echohl WarningMsg
echom "Git error: " . git_result
echom "Git cmd: " . git_cmd
echom "Tried to aply this"
echom string(selection)
echohl None
throw 'apply error'
endif
endfunction
......@@ -242,9 +254,12 @@ function! magit#git#git_unapply(header, selection, mode)
\ s:git_cmd . " apply --recount --no-index " . cached_flag . " --reverse - ",
\ selection)
if ( v:shell_error != 0 )
echoerr "Git error: " . git_result
echoerr "Tried to unaply this"
echoerr string(selection)
echohl WarningMsg
echom "Git error: " . git_result
echom "Tried to unaply this"
echom string(selection)
echohl None
throw 'unapply error'
endif
endfunction
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment