mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +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
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue