]> granicus.if.org Git - pdns/commitdiff
Make version correct on shallow copies
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 16 Jan 2019 16:07:02 +0000 (17:07 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 16 Jan 2019 16:07:02 +0000 (17:07 +0100)
Closes #7378

builder-support/gen-version

index 4dc3f09f865a1fcecc81b8e8df9122318b1b34b7..a3eb581319eb1b4ad14b071ca3743dbd4273e6bb 100755 (executable)
@@ -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