bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45187: git download defaults to origin/master


From: Ludovic Courtès
Subject: bug#45187: git download defaults to origin/master
Date: Mon, 14 Dec 2020 11:28:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Kyle Meyer <kyle@kyleam.com> skribis:

> diff --git a/guix/git.scm b/guix/git.scm
> index ca77b9f54b..7320c0d6c8 100644
> --- a/guix/git.scm
> +++ b/guix/git.scm
> @@ -207,6 +207,9 @@ (define (resolve-reference repository ref)
>         (let ((oid (reference-target
>                     (branch-lookup repository branch BRANCH-REMOTE))))
>           (object-lookup repository oid)))
> +      (('symref . symref)
> +       (let ((oid (reference-name->oid repository symref)))
> +         (object-lookup repository oid)))
>        (('commit . commit)
>         (let ((len (string-length commit)))
>           ;; 'object-lookup-prefix' appeared in Guile-Git in Mar. 2018, so we
> @@ -320,7 +323,7 @@ (define (reference-available? repository ref)
>  
>  (define* (update-cached-checkout url
>                                   #:key
> -                                 (ref '(branch . "master"))
> +                                 (ref '(symref . "refs/remotes/origin/HEAD"))
>                                   recursive?
>                                   (check-out? #t)
>                                   starting-commit
> @@ -395,7 +398,7 @@ (define* (latest-repository-commit store url
>                                     (log-port (%make-void-port "w"))
>                                     (cache-directory
>                                      (%repository-cache-directory))
> -                                   (ref '(branch . "master")))
> +                                   (ref '(symref . 
> "refs/remotes/origin/HEAD")))

Do we really need to add “remotes/origin” in there?  Or is there a way
to just say HEAD and later specify that we’re talking about the remote
head, as is done fro branches?

We also need to change the defaults in <git-checkout> & co., like Marius did.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]