summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions
index 4ea3c5a..60bcbe9 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -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