1 From 8efd731cc4ed2baa42aa69d0a9d336392e9987cb Mon Sep 17 00:00:00 2001
2 From: "Johnny S. Lee" <_@jsl.io>
3 Date: Sun, 26 Apr 2015 22:23:57 +0100
4 Subject: [PATCH 84/84] Make get-version work when repo is a git submodule.
7 bld/get-version | 5 +++--
8 1 file changed, 3 insertions(+), 2 deletions(-)
10 diff --git a/bld/get-version b/bld/get-version
11 index 7ab75db729ac..5372869c0852 100755
15 # If there is more than one v[0-9].* tag, sort them and use the
16 # first. This favours, eg v2.63 over 2.63rc6.
18 -if which git >/dev/null 2>&1 && [ -d $1/.git ]; then
19 - cd $1; git describe | sed 's/^v//'
20 +if which git >/dev/null 2>&1 && \
21 + ([ -d $1/.git ] || grep '^gitdir:' $1/.git >/dev/null 2>&1); then
22 + cd $1; git describe | sed 's/^v//'
23 elif grep '\$Format:%d\$' $1/VERSION >/dev/null 2>&1; then
24 # unsubstituted VERSION, but no git available.