~ruther/guix-local

66463356ce5868d3551ea7014acb34543972a5d8 — Romain GARBAGE 5 months ago 0a67098
git: Create/update remote references locally when needed.

This allows ‘update-cached-checkout’ to fetch symbolic references such as
those created by the AGit workflow with Forgejo instances.

* guix/git.scm (update-cached-checkout): Create/update remote references
locally.

Change-Id: Ice761d09eebc4f1275381a4eefbdd679d9b95127
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
1 files changed, 8 insertions(+), 4 deletions(-)

M guix/git.scm
M guix/git.scm => guix/git.scm +8 -4
@@ 593,16 593,20 @@ current settings unchanged."
     ;; left unchanged when cloning and pulling.
     (set-config-string config "core.autocrlf" "input")

     ;; Only fetch remote if it has not been cloned just before.
     ;; When using symrefs, fetch remote again even if it has been cloned just
     ;; before as the requested reference are not fetched when cloning.
     (when (and cache-exists?
                (not (null? symref-list))
                (not (reference-available? repository ref)))
       (remote-fetch (remote-lookup repository "origin")
                     #:fetch-options (make-default-fetch-options
                                      #:verify-certificate?
                                      verify-certificate?)
                     ;; Symbolic references are not fetched from the remote by
                     ;; default.
                     #:refspecs symref-list))
                     ;; Build refspecs from symbolic references so they are
                     ;; created locally and updated if necessary.
                     #:refspecs (map (lambda (ref)
                                       (string-append "+" ref ":" ref))
                                     symref-list)))
     (when recursive?
       (update-submodules repository #:log-port log-port
                          #:fetch-options