From: Pieter Lexis Date: Wed, 16 Jan 2019 16:07:02 +0000 (+0100) Subject: Make version correct on shallow copies X-Git-Tag: rec-4.2.0-alpha1~28^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7379%2Fhead;p=thirdparty%2Fpdns.git Make version correct on shallow copies Closes #7378 --- diff --git a/builder-support/gen-version b/builder-support/gen-version index 4dc3f09f86..a3eb581319 100755 --- a/builder-support/gen-version +++ b/builder-support/gen-version @@ -44,6 +44,7 @@ if [ ! -z "$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" ]; then # This _should_ be ok for forever is we stick to X.Y.Z for version numbers LAST_TAG=0.0 COMMITS_SINCE_TAG="$(git rev-list --count 12c868770afc20b6cc0da439d881105151d557dd..HEAD 2> /dev/null).0" + [ "${COMMITS_SINCE_TAG}" = ".0" ] && COMMITS_SINCE_TAG=0.0 GIT_HASH="$(git rev-parse HEAD | cut -c1-10 2> /dev/null)" fi