]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
Don't get iw version from git if there is no .git/
authorFlorian Schmaus <fschmaus@gmail.com>
Fri, 6 Sep 2013 15:41:10 +0000 (17:41 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 1 Oct 2013 11:03:15 +0000 (13:03 +0200)
The version.sh script should only try to get the version from git if the
source actually resides in a git repository, i.e. .git/ exists. Doing
otherwise in a non-git source repo results in git ascending until it
finds a .git directory, which will cause problems in some source-based
distributions ( https://bugs.gentoo.org/show_bug.cgi?id=482334 ).

version.sh

index 80e55abd734065130626981bb3c3f2b6f7a113f2..0f1aa1de70d9fcde250247af6cba2faf3cb4c2c0 100755 (executable)
@@ -3,7 +3,7 @@
 VERSION="3.11"
 OUT="$1"
 
-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
        git update-index --refresh --unmerged > /dev/null
        descr=$(git describe)