aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-09-27 22:15:58 +0800
committerXu Cheng2015-09-28 21:46:59 +0800
commitb37a28514126ac46e06cc1f5c8cc124a0fdff7f1 (patch)
treef7f8bd503e3ce6ff96610aa104b6b1cba2169a5c
parent79f71ca2ef7121d827f06f356c4c0d2d6610bdf0 (diff)
downloadbrew-b37a28514126ac46e06cc1f5c8cc124a0fdff7f1.tar.bz2
test-bot: fix start_revision for Travis
When a PR is merged during the test, the commit tree will be looked like this: master PR \ / \ / | root The start_revision will be poined to the commit used to merging PR, instead of common root commit. As result, `git diff-tree start end` will list file changes both in PR and master branch, which later contributes to additional formulae are tested in some Travis builds. To fix the problem, we use `git merge-base` to get common ancestor as the real start_revision. Closes Homebrew/homebrew#44379. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Homebrew/cmd/test-bot.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 58b30c405..66f23d873 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -318,6 +318,7 @@ module Homebrew
# Use Travis CI Git variables for master or branch jobs.
elsif ENV["TRAVIS_COMMIT_RANGE"]
diff_start_sha1, diff_end_sha1 = ENV["TRAVIS_COMMIT_RANGE"].split "..."
+ diff_start_sha1 = git("merge-base", diff_start_sha1, diff_end_sha1).strip
# Otherwise just use the current SHA-1 (which may be overriden later)
else
diff_end_sha1 = diff_start_sha1 = current_sha1