From dfca24180c96342fac05d665ea8b03c02e61204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 26 Mar 2018 00:12:52 +0200 Subject: [PATCH] git: 'latest-repository-commit' calls 'repository-close!'. * guix/git.scm (latest-repository-commit): Call 'repository-close!' when it exists. --- guix/git.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guix/git.scm b/guix/git.scm index d31c35f64f..103749d0e2 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -147,6 +147,13 @@ (define* (latest-repository-commit store url (when cache-exists? (remote-fetch (remote-lookup repository "origin"))) (switch-to-ref repository ref) + + ;; Reclaim file descriptors and memory mappings associated with + ;; REPOSITORY as soon as possible. + (when (module-defined? (resolve-interface '(git repository)) + 'repository-close!) + (repository-close! repository)) + (copy-to-store store cache-dir #:url url #:repository repository))))