Skip to content

Commit 662e32f

Browse files
0xc0170hugueskamba
authored andcommitted
CMake: Fix travis fetch PR (#13763)
Either fetch TRAVIS_COMMIT or the entire pull request (depending on the TRAVIS_PULL_REQUEST environment variable).
1 parent 8328963 commit 662e32f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ matrix:
134134
- >-
135135
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
136136
cd mbed-os;
137-
git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge;
138-
git checkout -qf FETCH_HEAD
137+
- to_fetch=("${TRAVIS_COMMIT}")
138+
- if [ false != "${TRAVIS_PULL_REQUEST-}" ]; then to_fetch+=("+refs/pull/${TRAVIS_PULL_REQUEST}/merge:"); fi
139+
- git fetch -q -- origin "${to_fetch[@]}"
140+
- git checkout -qf "${TRAVIS_COMMIT}" --
139141
- >-
140142
cd -;
141143
# Replace the content of mbed-os.lib to stay on ${TRAVIS_PULL_REQUEST}

0 commit comments

Comments
 (0)