Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions check-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ function set_environment_variables {
DIFF_BASE=${DIFF_BASE:-$TRAVIS_COMMIT^}
fi
DIFF_HEAD=${DIFF_HEAD:-$TRAVIS_COMMIT}
elif [[ ! -z "${BITBUCKET_BRANCH}" ]]; then
DIFF_BASE=${DIFF_BASE:-$BITBUCKET_COMMIT^}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glewiswp note that this will only compare with the previous commit which will lead to misleading results. See #197 and #229 for the same problem and a a proposed workaround for the same issue in Travis branch builds. What is needed here is the branch that the user intends to merge the changes into in order to be able to get the proper $DIFF_BASE. On Travis CI pull requests, this is available as $TRAVIS_BRANCH where it is defined as being the destination branch for where the changes will be merged. Nevertheless, for BitBucket it seems that the $BITBUCKET_BRANCH variable is not the pull request destination branch but rather the current branch, and thus it will have the exact same problem as Travis CI branch builds.

DIFF_HEAD=${DIFF_HEAD:-$BITBUCKET_COMMIT}
else
DIFF_BASE=${DIFF_BASE:-HEAD}
DIFF_HEAD=${DIFF_HEAD:-WORKING}
fi

while [[ $# > 0 ]]; do
key="$1"
case "$key" in
Expand Down