aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2015-02-19 10:55:42 +0000
committerMike McQuaid2015-02-19 11:06:20 +0000
commit804c3ae87a259c79ace08cc27fdc8984de98d1d5 (patch)
tree0d5477c24fb2ebbd5545ac80a29f707047acb690 /Library
parentd83c6344264e85bd9afa469ca21ca60f14e3d29e (diff)
downloadhomebrew-804c3ae87a259c79ace08cc27fdc8984de98d1d5.tar.bz2
pull: check bottle commit URL before branching.
Otherwise we annoyingly end up on a branch unnecessarily.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/pull.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index 25abd9187..5ab329f73 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -141,13 +141,16 @@ module Homebrew
end
if ARGV.include? "--bottle"
- bottle_branch = "pull-bottle-#{issue}"
- safe_system "git", "checkout", "-B", bottle_branch, revision
- if tap_name
- pull_url "https://github.com/BrewTestBot/homebrew-#{tap_name}/compare/homebrew:master...pr-#{issue}"
+ bottle_commit_url = if tap_name
+ "https://github.com/BrewTestBot/homebrew-#{tap_name}/compare/homebrew:master...pr-#{issue}"
else
- pull_url "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}"
+ "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}"
end
+ curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url
+
+ bottle_branch = "pull-bottle-#{issue}"
+ safe_system "git", "checkout", "-B", bottle_branch, revision
+ pull_url bottle_commit_url
safe_system "git", "rebase", branch
safe_system "git", "checkout", branch
safe_system "git", "merge", "--ff-only", "--no-edit", bottle_branch