unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: 32094@debbugs.gnu.org
Subject: [bug#32094] [PATCH] git: Call 'url-cache-directory' outside 'update-cached-checkout' body.
Date: Sun,  8 Jul 2018 13:19:35 +0300	[thread overview]
Message-ID: <20180708101935.7292-1-go.wigust@gmail.com> (raw)

* guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in
'cache-directory' key argument.
---
 guix/git.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/guix/git.scm b/guix/git.scm
index 9e89cc006..c5912170b 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
+                                   (%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
-- 
2.18.0

             reply	other threads:[~2018-07-08 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-08 10:19 Oleg Pykhalov [this message]
2018-07-08 10:24 ` [bug#32094] [PATCH] git: Call 'url-cache-directory' outside 'update-cached-checkout' body Oleg Pykhalov
2018-07-09 14:43 ` Ludovic Courtès
2018-07-10  3:39   ` Oleg Pykhalov
2018-07-11 10:01     ` Ludovic Courtès
2018-07-13 13:26       ` bug#32094: " Oleg Pykhalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180708101935.7292-1-go.wigust@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=32094@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).