mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
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.
This commit is contained in:
parent
f03d90e9de
commit
ec5f3d0cc8
1 changed files with 1 additions and 4 deletions
|
@ -12,10 +12,7 @@ DEF_VER=unknown
|
||||||
if test -f version
|
if test -f version
|
||||||
then
|
then
|
||||||
VN=$(cat version) || VN="$DEF_VER"
|
VN=$(cat version) || VN="$DEF_VER"
|
||||||
elif test -d .git -o -f .git && type git >/dev/null
|
elif ! VN=$(git describe --always --dirty 2>/dev/null); then
|
||||||
then
|
|
||||||
VN=$(git describe --always --dirty 2>/dev/null)
|
|
||||||
else
|
|
||||||
VN="$DEF_VER"
|
VN="$DEF_VER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue