summaryrefslogtreecommitdiffstats
path: root/version.sh
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-06 21:23:35 +0100
committerwm4 <wm4@nowhere>2013-02-06 23:03:37 +0100
commit314a07e787eac88486e5b3b5ed48aa37ae7cddfd (patch)
tree3bbf986c1ad53649f4835188a9b71d457e04d83e /version.sh
parent630a2b195acb3768b67ad81539fc0117a12c1293 (diff)
downloadmpv-314a07e787eac88486e5b3b5ed48aa37ae7cddfd.tar.bz2
mpv-314a07e787eac88486e5b3b5ed48aa37ae7cddfd.tar.xz
version.sh: fix git rev. generation (.git is not always a directory)
It appears git submodule handling recently changed, changing the .git directory to a regular file containing submodule specific information. This means that version.sh would generate "#define VERSION "git-UNKNOWN"" if the checkout is a submodule, because it explicitly checks for a .git directory using test -d. Change it to -e so that this case is handled correctly.
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/version.sh b/version.sh
index a907dd26ad..90a08ac10e 100755
--- a/version.sh
+++ b/version.sh
@@ -7,7 +7,7 @@ test "$1" && extra="-$1"
# Extract revision number from file used by daily tarball snapshots
# or from "git describe" output
git_revision=$(cat snapshot_version 2> /dev/null)
-test $git_revision || test ! -d .git || git_revision=`git rev-parse --short HEAD`
+test $git_revision || test ! -e .git || git_revision=`git rev-parse --short HEAD`
git_revision=$(expr "$git_revision" : v*'\(.*\)')
test $git_revision || git_revision=UNKNOWN