Appears to fetch incorrect pull request branch

I am testing out travis-ci integration on bitbucket cloud. I made a new branch called travis-ci and submitted a pull request. When looking at the travis build, I see the following lines where it should be making a temporary merge commit:

git fetch -q git@bitbucket.com://branch/master
git checkout -q FETCH_HEAD
git checkout -qb travis-ci
git merge --squash master

Notice that the first line says master. So what we are building is actually the master branch not the PR branch. I think it should be:

git fetch origin refs/heads/travis-ci
git checkout -q FETCH_HEAD
git checkout -qb travis-ci
git merge --squash master

When reporting problems, please consider including:

  1. What you are trying to achieve
  2. What you have tried (probably a link to the configuration)
  3. What happened instead (often, pointing to a build log URL, in the form of https://travis-ci.com/OWNER/REPO/build/NNNNNNN would be helpful).