Marius Bakke writes:
> Kyle Meyer <k...@kyleam.com> skriver: > >> One option may be to use the remote HEAD symref. [...] >> Here's a quick and dirty demo that makes your reproducer work. A real >> patch in this direction would of course look very different. > > Another quick and dirty patch to make this specific example work ... Thanks. > diff --git a/guix/git.scm b/guix/git.scm [...] > (define* (update-cached-checkout url > #:key > - (ref '(branch . "master")) > + (ref '(branch . "HEAD")) > recursive? > (check-out? #t) > starting-commit > @@ -349,7 +313,9 @@ it unchanged." > (('branch . branch) > `(branch . ,(if (string-prefix? "origin/" branch) > branch > - (string-append "origin/" branch)))) > + (if (string=? "HEAD" branch) > + branch > + (string-append "origin/" branch))))) > (_ ref))) I think using HEAD, rather than refs/remotes/origin/HEAD, will be problematic when the repository is already present in the cache. If I'm reading guix/git.scm correctly, a fetch is done in that case. refs/remotes/origin/HEAD will track any updates on the remote ref that it points to, while HEAD will stay on the same commit that it landed on at clone time.