From 7f7d73f1945e5fb4e1852a2ffc5facddbf9579a3 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 28 May 2017 00:52:36 -0500 Subject: [PATCH] CMake: Bugfix: run get_latest_tag only if git is recent enough Fixes #4420 --- cmake/scripts/get_closest_tag.sh | 5 +++++ cmake/scripts/get_latest_tag.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cmake/scripts/get_closest_tag.sh b/cmake/scripts/get_closest_tag.sh index 5166c9448c..803880e515 100755 --- a/cmake/scripts/get_closest_tag.sh +++ b/cmake/scripts/get_closest_tag.sh @@ -5,6 +5,11 @@ # - with shortest (positive) distance of the common ancestor to HEAD # +if ! git --version | grep -q "git version 2"; then + # This script requires version 2 or newer + exit 1 +fi + head="$(git rev-parse HEAD)" tags="$(git tag --sort=-creatordate)" diff --git a/cmake/scripts/get_latest_tag.sh b/cmake/scripts/get_latest_tag.sh index c29ace9920..ae880e8b86 100755 --- a/cmake/scripts/get_latest_tag.sh +++ b/cmake/scripts/get_latest_tag.sh @@ -4,6 +4,11 @@ # current HEAD # +if ! git --version | grep -q "git version 2"; then + # This script requires version 2 or newer + exit 1 +fi + head="$(git rev-parse HEAD)" tags="$(git tag --sort=-creatordate)" -- 2.39.5