aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-04-02 23:36:34 +0800
committerXu Cheng2016-04-03 00:01:38 +0800
commit591ef25442a0b5d085a3f682eb283fdb2e70c560 (patch)
tree1bddb6dc1d610ddc45d7264ea6f266a02b551de3 /Library
parentdeed8e566c096da391a92060f19e5093ec3cd1f6 (diff)
downloadbrew-591ef25442a0b5d085a3f682eb283fdb2e70c560.tar.bz2
pull: fallback to old BrewTestBot git repo when necessary
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/pull.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index 86018b47a..e73ead192 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -193,7 +193,16 @@ module Homebrew
bottle_branch = "pull-bottle-#{issue}"
"https://github.com/BrewTestBot/homebrew-#{tap.repo}/compare/homebrew:master...pr-#{issue}"
end
- curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url
+
+ bottle_commit_fallbacked = false
+ begin
+ curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url
+ rescue ErrorDuringExecution
+ raise if !ARGV.include?("--legacy") || bottle_commit_fallbacked
+ bottle_commit_url = "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}"
+ bottle_commit_fallbacked = true
+ retry
+ end
safe_system "git", "checkout", "-B", bottle_branch, revision
pull_patch bottle_commit_url