store: 'run-with-store' gracefully deals with #f store.
This is a followup to dd0ee954c4
, 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.
This commit is contained in:
parent
d74392a85c
commit
728a4ab101
|
@ -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.
|
||||
(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)))))
|
||||
(set-store-connection-object-cache! store cache)))
|
||||
result))))
|
||||
|
||||
|
||||
;;;
|
||||
|
|
Loading…
Reference in New Issue