[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: store: 'run-with-store' gracefully deals with #f store.
From: |
guix-commits |
Subject: |
03/03: store: 'run-with-store' gracefully deals with #f store. |
Date: |
Thu, 4 Jul 2019 18:51:29 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 728a4ab1019fda2f14a5c69d3f1b277fb5e09cda
Author: Ludovic Courtès <address@hidden>
Date: Fri Jul 5 00:48:20 2019 +0200
store: 'run-with-store' gracefully deals with #f store.
This is a followup to dd0ee954c4fa965023fd887452927c02edb8b52f, which
introduced a failure in tests/graph.scm.
* guix/store.scm (run-with-store): Check whether STORE and NEW-STORE are
true before calling 'store-connection-object-cache' etc. Fixes a
failure in tests/graph.scm related to %REVERSE-PACKAGE-NODE-TYPE, which
uses #f as the store.
---
guix/store.scm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/guix/store.scm b/guix/store.scm
index 52940ff..d7c6038 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1802,11 +1802,12 @@ connection, and return the result."
(call-with-values (lambda ()
(run-with-state mval store))
(lambda (result new-store)
- ;; Copy the object cache from NEW-STORE so we don't fully discard the
- ;; state.
- (let ((cache (store-connection-object-cache new-store)))
- (set-store-connection-object-cache! store cache)
- result)))))
+ (when (and store new-store)
+ ;; Copy the object cache from NEW-STORE so we don't fully discard
+ ;; the state.
+ (let ((cache (store-connection-object-cache new-store)))
+ (set-store-connection-object-cache! store cache)))
+ result))))
;;;