From 4816606938c8010c4b0133d334085334f47d8b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Galv=C3=A3o?= Date: Mon, 7 Nov 2016 10:54:52 +0000 Subject: [PATCH] before_script.sh: update to match main repo --- ci/travis/before_script.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ci/travis/before_script.sh b/ci/travis/before_script.sh index a3e6de9ba..c97a1ddf4 100755 --- a/ci/travis/before_script.sh +++ b/ci/travis/before_script.sh @@ -14,6 +14,17 @@ header 'Running before_script.sh...' # https://github.com/travis-ci/travis-ci/issues/6307#issuecomment-233315824 run rvm get head +# see https://github.com/travis-ci/travis-ci/issues/2666 +run export BRANCH_COMMIT="${TRAVIS_COMMIT_RANGE##*.}" +run export TARGET_COMMIT="${TRAVIS_COMMIT_RANGE%%.*}" +# shellcheck disable=SC2016 +if ! run 'MERGE_BASE="$(git merge-base "${BRANCH_COMMIT}" "${TARGET_COMMIT}")"'; then + run git fetch --unshallow + run 'MERGE_BASE="$(git merge-base "${BRANCH_COMMIT}" "${TARGET_COMMIT}")"' +fi +run export MERGE_BASE="${MERGE_BASE}" +run export TRAVIS_COMMIT_RANGE="${MERGE_BASE}...${BRANCH_COMMIT}" + # capture system ruby and gem locations run export SYSTEM_RUBY_HOME="/System/Library/Frameworks/Ruby.framework/Versions/Current" run export SYSTEM_RUBY_BINDIR="${SYSTEM_RUBY_HOME}/usr/bin"