]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
build_tools/make_version: Get MAINLINE_BRANCH from .gitreview.
authorCorey Farrell <git@cfware.com>
Sat, 21 Jul 2018 16:22:27 +0000 (12:22 -0400)
committerCorey Farrell <git@cfware.com>
Sun, 22 Jul 2018 16:24:32 +0000 (12:24 -0400)
Use .gitreview defaultbranch setting to determine the mainline branch.
This allows the script to be used against other directories which might
not be on the same defaultbranch.  This can be used by CI scripts to
report the testsuite version being used:
./build_tools/make_version ${TESTSUITE_DIR}

Change-Id: Ifdad4a9d8a26138c41bc6b630ecc3e34ea1c2758

build_tools/make_version

index fbff4eaf89afa7685c348601e856555484cdb2c8..ad9fb3f92427e0e192fb0db2a881b985c834ee14 100755 (executable)
@@ -3,7 +3,6 @@
 AWK=${AWK:-awk}
 GIT=${GIT:-git}
 GREP=${GREP:-grep}
-MAINLINE_BRANCH=13
 
 if [ -f ${1}/.version ]; then
     cat ${1}/.version
@@ -101,6 +100,7 @@ elif [ -d ${1}/.git ]; then
     MODIFIED=""
     SVN_REV=`${GIT} log --pretty=full -1 | ${GREP} -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
     if [ -z "$SVN_REV" ]; then
+        MAINLINE_BRANCH=$(git config -f .gitreview --get gerrit.defaultbranch)
         VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
         if [ $? -ne 0 ]; then
             if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then