summaryrefslogtreecommitdiff
path: root/guix/scripts/time-machine.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-11-15 21:11:58 +0100
committerLudovic Courtès <ludo@gnu.org>2019-11-15 23:29:06 +0100
commitd17e012da7b41165cb49a5604a773459736144e3 (patch)
treecd7b42134b97d37c6d0dc86ba009a16d5e455b27 /guix/scripts/time-machine.scm
parent067305977c4580c71c579b098af1e9dee85ce10a (diff)
downloadguix-patches-d17e012da7b41165cb49a5604a773459736144e3.tar
guix-patches-d17e012da7b41165cb49a5604a773459736144e3.tar.gz
time-machine: Handle 'git-error' exceptions.
* guix/scripts/pull.scm (with-git-error-handling): Export. * guix/scripts/time-machine.scm (guix-time-machine): Wrap body in 'with-git-error-handling'.
Diffstat (limited to 'guix/scripts/time-machine.scm')
-rw-r--r--guix/scripts/time-machine.scm20
1 files changed, 11 insertions, 9 deletions
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index a64badc27b..946b523741 100644
--- a/guix/scripts/time-machine.scm
+++ b/guix/scripts/time-machine.scm
@@ -22,7 +22,8 @@
#:use-module (guix inferior)
#:use-module (guix channels)
#:use-module (guix store)
- #:use-module ((guix scripts pull) #:select (channel-list))
+ #:use-module ((guix scripts pull)
+ #:select (with-git-error-handling channel-list))
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
@@ -94,11 +95,12 @@ Execute COMMAND ARGS... in an older version of Guix.\n"))
(define (guix-time-machine . args)
(with-error-handling
- (let* ((opts (parse-args args))
- (channels (channel-list opts))
- (command-line (assoc-ref opts 'exec)))
- (when command-line
- (let* ((directory (with-store store
- (cached-channel-instance store channels)))
- (executable (string-append directory "/bin/guix")))
- (apply execl (cons* executable executable command-line)))))))
+ (with-git-error-handling
+ (let* ((opts (parse-args args))
+ (channels (channel-list opts))
+ (command-line (assoc-ref opts 'exec)))
+ (when command-line
+ (let* ((directory (with-store store
+ (cached-channel-instance store channels)))
+ (executable (string-append directory "/bin/guix")))
+ (apply execl (cons* executable executable command-line))))))))