mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-04-10 12:49:55 +00:00
Merge pull request #1504 from cmuellner/git-annotated-tags
scripts/functions: Add better support for annotanted git tags
This commit is contained in:
commit
f9716e8b90
@ -1951,8 +1951,14 @@ CT_GetVersion_git()
|
||||
local branch="${devel_branch:-master}"
|
||||
|
||||
if [ -z "${devel_revision}" ]; then
|
||||
local matches=`git ls-remote --exit-code "${devel_url}" --refs "${branch}" \
|
||||
# First try to dereference an annotated tag.
|
||||
local matches=`git ls-remote --exit-code "${devel_url}" --refs "${branch}^{}" \
|
||||
|| echo "not found"`
|
||||
# If we don't have an annotated tag, let's take the reference as is.
|
||||
if [ "${matches}" = "not found" ]; then
|
||||
matches=`git ls-remote --exit-code "${devel_url}" --refs "${branch}" \
|
||||
|| echo "not found"`
|
||||
fi
|
||||
local best using ref
|
||||
|
||||
# Cannot test $?, setting a trap on ERR prevents bash from returning the
|
||||
|
Loading…
x
Reference in New Issue
Block a user