Make magit-run* look in the magit-process-buffer for a useful error
string when reporting an error, and fall back on the less helpful "Git failed" message only if no error message could be found in the buffer.
This commit is contained in:
parent
17753d31fd
commit
36ace412b6
1 changed files with 7 additions and 1 deletions
8
magit.el
8
magit.el
|
@ -1640,7 +1640,13 @@ FUNC should leave point at the end of the modified region"
|
|||
(magit-need-refresh magit-process-client-buffer))))
|
||||
(or successp
|
||||
noerror
|
||||
(error "Git failed"))
|
||||
(error
|
||||
(or (save-excursion
|
||||
(set-buffer (get-buffer magit-process-buffer-name))
|
||||
(when (re-search-backward
|
||||
(concat "^error: \\(.*\\)" paragraph-separate) nil t)
|
||||
(match-string 1)))
|
||||
"Git failed")))
|
||||
successp)))
|
||||
|
||||
(autoload 'dired-uncache "dired")
|
||||
|
|
Loading…
Reference in a new issue