Skip to contentSkip to conversation

Don't get iw version from git if there is no .git/

PATCH Applied Florian Schmaus 2 participants 2 messages Sep 6, 2013 – Oct 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't get iw version from git if there is no .git/

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
version.sh +1 -1
index 80e55ab..0f1aa1d 100755
@@ -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)
 
Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 5 lines · Florian Schmaus

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 ).

Applied.

johannes