TRAVIS_PULL_REQUEST is false for non-PRs, not empty (#9439)

Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
mehrdadn
2020-07-13 05:52:40 -07:00
committed by GitHub
parent b5a6c57295
commit 5291bf235b
+1 -1
View File
@@ -13,7 +13,7 @@ before_install:
git clone -q -n "https://github.com/${TRAVIS_REPO_SLUG}.git" "${TRAVIS_REPO_SLUG}"
cd -- "${TRAVIS_REPO_SLUG}"
to_fetch=("${TRAVIS_COMMIT}")
if [ -n "${TRAVIS_PULL_REQUEST-}" ]; then to_fetch+=("+refs/pull/${TRAVIS_PULL_REQUEST}/merge:"); fi
if [ false != "${TRAVIS_PULL_REQUEST-}" ]; then to_fetch+=("+refs/pull/${TRAVIS_PULL_REQUEST}/merge:"); fi
git fetch -q -- origin "${to_fetch[@]}"
git checkout -qf "${TRAVIS_COMMIT}" --