From a9e9efd6acb48177bcbfdff3371843c9ce13cb78 Mon Sep 17 00:00:00 2001 From: "fox.cpp" Date: Tue, 2 Jun 2020 19:01:29 +0300 Subject: [PATCH] build.sh: Switch to X.Y-fixes branch if it exists --- build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.sh b/build.sh index f2b8603..72d62bd 100755 --- a/build.sh +++ b/build.sh @@ -307,6 +307,15 @@ ensure_source_tree() { MADDY_MAJOR=$(sed 's/^v//' <<<$DESCR | cut -f1 -d '.') MADDY_MINOR=$(cut -f2 -d '.' <<<$DESCR ) + + set +e + if git branch -r | grep "origin/$MADDY_MAJOR.$MADDY_MINOR-fixes" >/dev/null; then + echo "--- Using $MADDY_MAJOR.$MADDY_MINOR-fixes tree" >&2 + git checkout "$MADDY_MAJOR.$MADDY_MINOR-fixes" + DESCR=$(git describe --long 2>/dev/null) + fi + set -e + MADDY_PATCH=$(cut -f1 -d '-' <<<$DESCR | sed 's/-.+//' | cut -f3 -d '.') MADDY_SNAPSHOT=$(cut -f2 -d '-' <<<$DESCR) MADDY_COMMIT=$(cut -f3 -d '-' <<<$DESCR)