From b3ed00b791b5e95519b3a59a578a09dd084c44ab Mon Sep 17 00:00:00 2001
From: Mike McQuaid <mike@mikemcquaid.com>
Date: Thu, 14 Jul 2016 10:10:34 +0100
Subject: [PATCH] test-bot: use another method to find Jenkins PR.

---
 Library/Homebrew/dev-cmd/test-bot.rb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index 40e99f7b6e..9b9b65614b 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -304,6 +304,11 @@ module Homebrew
         @url = ENV["ghprbPullLink"]
         @hash = nil
         test "git", "checkout", "origin/master"
+      elsif ENV["GIT_BRANCH"] && ENV["GIT_URL"]
+        %r{origin/pr/(\d+)/(merge|head)} =~ ENV["GIT_BRANCH"]
+        pr = $1
+        @url = "#{ENV["GIT_URL"]}/pull/#{pr}"
+        @hash = nil
       # Use Travis CI pull-request variables for pull request jobs.
       elsif travis_pr
         @url = "https://github.com/#{ENV["TRAVIS_REPO_SLUG"]}/pull/#{ENV["TRAVIS_PULL_REQUEST"]}"
-- 
GitLab