git: 'switch-to-ref' resolves tag targets.
* guix/git.scm (switch-to-ref): In the 'tag' case, resolve the target of the tag. * tests/guix-build-branch.sh: Adjust test accordingly.
This commit is contained in:
parent
177fecb57c
commit
10a8c2bbc6
|
@ -172,7 +172,11 @@ OID (roughly the commit hash) corresponding to REF."
|
||||||
(('tag . tag)
|
(('tag . tag)
|
||||||
(let ((oid (reference-name->oid repository
|
(let ((oid (reference-name->oid repository
|
||||||
(string-append "refs/tags/" tag))))
|
(string-append "refs/tags/" tag))))
|
||||||
(object-lookup repository oid))))))
|
;; Get the commit that the tag at OID refers to. This is not
|
||||||
|
;; strictly needed, but it's more consistent to always return the
|
||||||
|
;; OID of a commit.
|
||||||
|
(object-lookup repository
|
||||||
|
(tag-target-id (tag-lookup repository oid))))))))
|
||||||
|
|
||||||
(reset repository obj RESET_HARD)
|
(reset repository obj RESET_HARD)
|
||||||
(object-id obj))
|
(object-id obj))
|
||||||
|
|
|
@ -54,7 +54,7 @@ test "$v0_1_0_drv" != "$orig_drv"
|
||||||
|
|
||||||
v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`"
|
v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`"
|
||||||
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.v0.1.0
|
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.v0.1.0
|
||||||
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-8fe64e8 # this is the *tag* ID
|
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-9e3eacd
|
||||||
test "$v0_1_0_drv" != "$latest_drv"
|
test "$v0_1_0_drv" != "$latest_drv"
|
||||||
test "$v0_1_0_drv" != "$orig_drv"
|
test "$v0_1_0_drv" != "$orig_drv"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue