From a2facf56aab18dd49bcd9b561cb5d835ada40fe9 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 9 Dec 2017 09:22:13 +0000 Subject: [PATCH] build.sh: Use the TRAVIS_CI variable if it's provided. Travisci appears to work in a detached head, but commands like ``git symbolic-ref --short HEAD`` return ``HEAD`` instead of ``master`` in detached head states. At least if we're in travisci this should work. https://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git --- build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index aef1d9d857..9e4398d085 100755 --- a/build.sh +++ b/build.sh @@ -557,7 +557,11 @@ current_git_branch() { } find_branch() { - CURRENT_BRANCH=$(current_git_branch) + if [ -z ${TRAVIS_BRANCH} ]; then + CURRENT_BRANCH=$(current_git_branch) + else + CURRENT_BRANCH=${TRAVIS_BRANCH} + fi } checksum_url() { -- 2.34.1