aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2018-07-08 13:15:41 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2018-07-13 16:24:48 +0300
commitffc3fcade3f7d2c7d26b2fe5245902e6407f9c93 (patch)
treec287402409d5ec49cec6d372be67006a34c874a9
parente29067d22e89743b9d2c7a68987d7b892a3d304a (diff)
downloadpatches-ffc3fcade3f7d2c7d26b2fe5245902e6407f9c93.tar
patches-ffc3fcade3f7d2c7d26b2fe5245902e6407f9c93.tar.gz
git: Call 'url-cache-directory' outside 'update-cached-checkout'.
* guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in 'cache-directory' key argument. (latest-repository-commit): Call 'url-cache-directory'.
-rw-r--r--guix/git.scm26
1 files changed, 14 insertions, 12 deletions
diff --git a/guix/git.scm b/guix/git.scm
index 9e89cc0062..193e2df111 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -114,7 +114,8 @@ OID (roughly the commit hash) corresponding to REF."
#:key
(ref '(branch . "origin/master"))
(cache-directory
- (%repository-cache-directory)))
+ (url-cache-directory
+ url (%repository-cache-directory))))
"Update the cached checkout of URL to REF in CACHE-DIRECTORY. Return two
values: the cache directory name, and the SHA1 commit (a string) corresponding
to REF.
@@ -122,11 +123,10 @@ to REF.
REF is pair whose key is [branch | commit | tag] and value the associated
data, respectively [<branch name> | <sha1> | <tag name>]."
(with-libgit2
- (let* ((cache-dir (url-cache-directory url cache-directory))
- (cache-exists? (openable-repository? cache-dir))
+ (let* ((cache-exists? (openable-repository? cache-directory))
(repository (if cache-exists?
- (repository-open cache-dir)
- (clone* url cache-dir))))
+ (repository-open cache-directory)
+ (clone* url cache-directory))))
;; Only fetch remote if it has not been cloned just before.
(when cache-exists?
(remote-fetch (remote-lookup repository "origin")))
@@ -138,7 +138,7 @@ data, respectively [<branch name> | <sha1> | <tag name>]."
'repository-close!)
(repository-close! repository))
- (values cache-dir (oid->string oid))))))
+ (values cache-directory (oid->string oid))))))
(define* (latest-repository-commit store url
#:key
@@ -157,12 +157,14 @@ Git repositories are kept in the cache directory specified by
(and (string=? (basename file) ".git")
(eq? 'directory (stat:type stat))))
- (let*-values (((checkout commit)
- (update-cached-checkout url
- #:ref ref
- #:cache-directory cache-directory))
- ((name)
- (url+commit->name url commit)))
+ (let*-values
+ (((checkout commit)
+ (update-cached-checkout url
+ #:ref ref
+ #:cache-directory
+ (url-cache-directory url cache-directory)))
+ ((name)
+ (url+commit->name url commit)))
(values (add-to-store store name #t "sha256" checkout
#:select? (negate dot-git?))
commit)))