git: Add an exception printer for 'git-error'.

* guix/git.scm (print-git-error): New procedure.
<top level>: Call 'set-exception-printer!'.
This commit is contained in:
Ludovic Courtès 2019-02-11 22:51:08 +01:00
parent 70a50305c4
commit 1d8b10d00f
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -300,6 +300,14 @@ (define (dot-git? file stat)
#:select? (negate dot-git?))
commit)))
(define (print-git-error port key args default-printer)
(match args
(((? git-error? error) . _)
(format port (G_ "Git error: ~a~%")
(git-error-message error)))))
(set-exception-printer! 'git-error print-git-error)
;;;
;;; Checkouts.