diff options
author | Kevin Ballard <kevin@sb.org> | 2014-10-27 15:46:22 -0700 |
---|---|---|
committer | Kevin Ballard <kevin@sb.org> | 2014-10-27 15:46:22 -0700 |
commit | ec5f3d0cc80ae6e19a8dd795051ec680b6820b91 (patch) | |
tree | a837d7725bde527c2bd782e451887dc1152453b2 /build_tools | |
parent | f03d90e9de5752bb12e141ee5d96c8030ca2d83a (diff) |
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.
Diffstat (limited to 'build_tools')
-rwxr-xr-x | build_tools/git_version_gen.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/build_tools/git_version_gen.sh b/build_tools/git_version_gen.sh index 282ac27d..ac3c2618 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 |