Skip to content

Commit

Permalink
Merge pull request moby#3652 from tianon/fix-travis-on-non-master-prs
Browse files Browse the repository at this point in the history
Fix Travis for PRs against non-master (like release, for example)
  • Loading branch information
tianon committed Jan 20, 2014
2 parents cfd3d02 + 980e0bf commit 3bd3615
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 3bd3615

Please sign in to comment.