Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vimagit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jreybert
vimagit
Commits
2e2bf2ea
Commit
2e2bf2ea
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
utoload/git.vim: print error messages with echom
parent
25698b69
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autoload/magit/git.vim
+28
-13
28 additions, 13 deletions
autoload/magit/git.vim
with
28 additions
and
13 deletions
autoload/magit/git.vim
+
28
−
13
View file @
2e2bf2ea
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment