I think I found a strange issue with Travis while working on a GitHub organization I have write access to:
Under some tricky circumstances, Travis may try to pull a non-existing branch.
How to reproduce:
0. Setup: A repo with Travis set up (
language: minimal is enough for the Travis configuration), in those howto, I’ll use an organization repo and will refer it as the org repo.
- Fork the org repo
- Create a branch and a commit, set the upstream to a new branch on the org repo and push it.
- Delete the remote branch you just created on the org repo.
- Change the upstream of your local branch to your fork, but still use the same branch name (i.e. if remote branch name was foo on the org repo, keep using foo in your fork.
- Push it, and create a PR
- Check the PR on GitHub, you should have two builds instead of just one: One for the branch, another for the PR.
- If you check the branch one, you’ll see that Travis tried to clone the branch you deleted on the org repo.
- A faulty PR: https://github.com/psychic-disco/verbose-guacamole/pull/1
- And its faulty build: https://travis-ci.com/psychic-disco/verbose-guacamole/builds/123137863