summaryrefslogtreecommitdiff
path: root/mkgitver
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-08-15 21:52:13 -0700
committerWayne Davison <wayne@opencoder.net>2022-08-15 21:52:13 -0700
commit68b1ce1dc3605a8b79594ba5e8e29577ea6dc42c (patch)
treecfd20f1eac3dd2a437d506443a798dfb103dcfb6 /mkgitver
parent5a4116e553551ed314eea4bc85db8f54fd5fd03b (diff)
downloadrsync-68b1ce1dc3605a8b79594ba5e8e29577ea6dc42c.tar.gz
Only run git describe if .git exists in the $srcdir.
Diffstat (limited to 'mkgitver')
-rwxr-xr-xmkgitver5
1 files changed, 4 insertions, 1 deletions
diff --git a/mkgitver b/mkgitver
index 49aa150b..43156c65 100755
--- a/mkgitver
+++ b/mkgitver
@@ -1,7 +1,10 @@
#!/bin/sh
srcdir=`dirname $0`
-gitver=`git describe --abbrev=8 2>/dev/null`
+
+if [ -e "$srcdir/.git" ]; then
+ gitver=`git describe --abbrev=8 2>/dev/null`
+fi
if [ ! -f git-version.h ]; then
touch git-version.h