git: 'latest-repository-commit' calls 'repository-close!'.

* guix/git.scm (latest-repository-commit): Call 'repository-close!'
when it exists.
This commit is contained in:
Ludovic Courtès 2018-03-26 00:12:52 +02:00
parent ae0a5a7edc
commit dfca24180c
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 0 deletions

View File

@ -147,6 +147,13 @@ Git repositories are kept in the cache directory specified by
(when cache-exists? (when cache-exists?
(remote-fetch (remote-lookup repository "origin"))) (remote-fetch (remote-lookup repository "origin")))
(switch-to-ref repository ref) (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 (copy-to-store store cache-dir
#:url url #:url url
#:repository repository)))) #:repository repository))))