From fe87a8146fc425f70156254c2f7f334ff6d848da Mon Sep 17 00:00:00 2001 From: Igor Chorazewicz Date: Thu, 14 Mar 2019 12:05:29 +0100 Subject: [PATCH] common: Adjust TRAVIS_COMMIT_RANGE variable in pull-or-rebuild-image.sh to contain only commits from a PR. Ref: travis-ci/travis-ci/issues/4596 --- utils/docker/pull-or-rebuild-image.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/docker/pull-or-rebuild-image.sh b/utils/docker/pull-or-rebuild-image.sh index 8aa184dd503..d1e5fcdab2e 100755 --- a/utils/docker/pull-or-rebuild-image.sh +++ b/utils/docker/pull-or-rebuild-image.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2016-2018, Intel Corporation +# Copyright 2016-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -85,7 +85,11 @@ fi # Find all the commits for the current build if [[ -n "$TRAVIS_COMMIT_RANGE" ]]; then - commits=$(git rev-list $TRAVIS_COMMIT_RANGE) + # $TRAVIS_COMMIT_RANGE contains "..." instead of ".." + # https://github.com/travis-ci/travis-ci/issues/4596 + PR_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" + + commits=$(git rev-list $PR_COMMIT_RANGE) else commits=$TRAVIS_COMMIT fi