Skip to content

Commit

Permalink
Fix Travis for PRs against non-master (like release, for example)
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Andrew Page <[email protected]> (github: tianon)
  • Loading branch information
tianon committed Jan 18, 2014
1 parent dc359e0 commit 980e0bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq python-yaml
- git remote add upstream git://github.com/dotcloud/docker.git
- git fetch --append --no-tags upstream refs/heads/master:refs/remotes/upstream/master
- upstream=master;
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
upstream=$TRAVIS_BRANCH;
fi;
git fetch --append --no-tags upstream refs/heads/$upstream:refs/remotes/upstream/$upstream
# sometimes we have upstream master already as origin/master (PRs), but other times we don't, so let's just make sure we have a completely unambiguous way to specify "upstream master" from here out
# but if it's a PR against non-master, we need that upstream branch instead :)

script:
- hack/travis/dco.py
Expand Down
2 changes: 1 addition & 1 deletion hack/travis/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
exit(127)

if os.environ['TRAVIS_PULL_REQUEST'] != 'false':
commit_range = [os.environ['TRAVIS_BRANCH'], 'FETCH_HEAD']
commit_range = ['upstream/' + os.environ['TRAVIS_BRANCH'], 'FETCH_HEAD']
else:
try:
subprocess.check_call([
Expand Down

0 comments on commit 980e0bf

Please sign in to comment.