diff --git a/.travis.yml b/.travis.yml
index 6f6c8e290d2058625c3132f521cb8ebec4e1d6fc..ce205d4f11c2374e467276016105148ab37972d1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,6 +30,7 @@ install:
         sudo apt-get install $(./dist/tools/travis-scripts/get-pkg-list.py)
     - git config --global user.email "travis@example.com"
     - git config --global user.name "Travis CI"
+    - test "$TRAVIS_BRANCH" = "master" || git fetch origin $TRAVIS_BRANCH:$TRAVIS_BRANCH
 
 script:
     - ./dist/tools/travis-scripts/build_and_test.sh
diff --git a/dist/tools/travis-scripts/build_and_test.sh b/dist/tools/travis-scripts/build_and_test.sh
index b060480dc2abf2048bf3823f6511e7fd42503c6e..475ad9f1af8e830a58c50cd03806e18c2242d953 100755
--- a/dist/tools/travis-scripts/build_and_test.sh
+++ b/dist/tools/travis-scripts/build_and_test.sh
@@ -70,5 +70,5 @@ then
         #   resolved:
         #   - make -C ./tests/unittests all test BOARD=qemu-i386 || exit
     fi
-    ./dist/tools/compile_test/compile_test.py master
+    ./dist/tools/compile_test/compile_test.py $TRAVIS_BRANCH
 fi