diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/functions | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions index 4ea3c5a8..60bcbe96 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 |