GNU bug report logs -
#53144
[PATCH 0/13] Make more git-using packages auto-updatable
Previous Next
Full log
View this message in rfc822 format
Maxime Devos <maximedevos <at> telenet.be> skribis:
> * guix/git.scm (remote-refs): Split off some logic to ...
> (call-with-detached-remote): ... this new procedure.
> (lookup-reference): New procedure.
> * tests/git.scm ("lookup-reference: branch and HEAD"): New test.
[...]
> +;; TODO: it would be nice to use 'remote-create-detached' here,
> +;; but that procedure isn't in any released version of guile-git yet.
> +(define (call-with-detached-remote url proc)
Let’s prepare a new Guile-Git release then (Erik Edrosa has been MIA
lately, but Marius, Mathieu, or myself can tag a release when needed).
> + "Call PROC with a remote for URL. The remote is closed after PROC returns."
> + (call-with-temporary-directory
> + (lambda (cache-directory)
> + (let* ((repository (repository-init cache-directory))
> + ;; Create an in-memory remote so we don't touch disk.
> + (remote (remote-create-anonymous repository url)))
> + (remote-connect remote)
> + (let-values ((result (proc remote)))
s/let-values/let/
> + ;; Wait until we're finished with the repository before closing it.
> + (remote-disconnect remote)
> + (repository-close! repository)
> + (apply values result))))))
We can use this code until Guile-Git provides ‘remote-create-detached’
though.
Otherwise LGTM!
Ludo’.
This bug report was last modified 209 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.