git-r3.eclass: Accept any ref rather than refs/heads/* only
authorMichał Górny <mgorny@gentoo.org>
Sat, 26 Sep 2015 13:18:16 +0000 (15:18 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 29 Nov 2015 10:03:17 +0000 (11:03 +0100)
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=556822

eclass/git-r3.eclass

index faee4588f852dc1ca949f3c1064b23a4cef53cf5..8b5ffd5318456ef0edc4d9f34b8d2b1e0c5cd660 100644 (file)
@@ -581,8 +581,8 @@ git-r3_fetch() {
                        if [[ ${remote_ref} == HEAD ]]; then
                                # HEAD
                                fetch_l=HEAD
-                       elif [[ ${remote_ref} == refs/heads/* ]]; then
-                               # regular branch
+                       elif [[ ${remote_ref} == refs/* ]]; then
+                               # regular branch, tag or some other explicit ref
                                fetch_l=${remote_ref}
                        else
                                # tag or commit id...
@@ -919,7 +919,7 @@ git-r3_peek_remote_ref() {
                einfo "Peeking \e[1m${remote_ref}\e[22m on \e[1m${r}\e[22m ..." >&2
 
                local lookup_ref
-               if [[ ${remote_ref} == refs/heads/* || ${remote_ref} == HEAD ]]
+               if [[ ${remote_ref} == refs/* || ${remote_ref} == HEAD ]]
                then
                        lookup_ref=${remote_ref}
                else