CMake: Fix travis fetch PR (#13763)

Either fetch TRAVIS_COMMIT or the entire pull request (depending on the TRAVIS_PULL_REQUEST environment variable).
pull/13566/head
Martin Kojtal 2020-10-15 17:46:20 +01:00 committed by Hugues Kamba
parent 8328963a67
commit 662e32ffb7
1 changed files with 4 additions and 2 deletions

View File

@ -134,8 +134,10 @@ matrix:
- >-
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
cd mbed-os;
git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge;
git checkout -qf FETCH_HEAD
- to_fetch=("${TRAVIS_COMMIT}")
- 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}" --
- >-
cd -;
# Replace the content of mbed-os.lib to stay on ${TRAVIS_PULL_REQUEST}