From ec5f3d0cc80ae6e19a8dd795051ec680b6820b91 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Mon, 27 Oct 2014 15:46:22 -0700 Subject: [PATCH] Don't require .git before running git-describe When calculating the version, we don't need to test for the presence of .git before running `git describe`. This lets us work properly in a detached work tree if GIT_DIR is set. --- build_tools/git_version_gen.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build_tools/git_version_gen.sh b/build_tools/git_version_gen.sh index 282ac27d3..ac3c26186 100755 --- a/build_tools/git_version_gen.sh +++ b/build_tools/git_version_gen.sh @@ -12,10 +12,7 @@ DEF_VER=unknown if test -f version then VN=$(cat version) || VN="$DEF_VER" -elif test -d .git -o -f .git && type git >/dev/null -then - VN=$(git describe --always --dirty 2>/dev/null) -else +elif ! VN=$(git describe --always --dirty 2>/dev/null); then VN="$DEF_VER" fi