]> granicus.if.org Git - libvpx/commitdiff
Fix for version.sh when libvpx is checked out as git submodule
authorBrion Vibber <bvibber@wikimedia.org>
Wed, 4 May 2016 19:41:32 +0000 (15:41 -0400)
committerBrion Vibber <bvibber@wikimedia.org>
Wed, 4 May 2016 19:41:32 +0000 (15:41 -0400)
When using git submodules, .git may be a file instead of a directory.
The -d test was failing in that case; switched to -e.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1215

Change-Id: Iedf0e92bfeb003b28a415945dc729e6ce58c4fe4

build/make/version.sh

index b340142c934346847273d2ab96db9f6ec88c48a5..6967527771b084045b6ece4ddc945a5cb3648941 100755 (executable)
@@ -24,8 +24,9 @@ out_file=${2}
 id=${3:-VERSION_STRING}
 
 git_version_id=""
-if [ -d "${source_path}/.git" ]; then
+if [ -e "${source_path}/.git" ]; then
     # Source Path is a git working copy. Check for local modifications.
+    # Note that git submodules may have a file as .git, not a directory.
     export GIT_DIR="${source_path}/.git"
     git_version_id=`git describe --match=v[0-9]* 2>/dev/null`
 fi