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
commit258c4ddefe60f65570aee2aef9243eb23a6ee5a9 (patch)
tree788445c21e5c7a78edf98c5a29b032457fa32270 /Library
parent40e64263226d4017b2437fbd5fd777c41ab3f063 (diff)
downloadbrew-258c4ddefe60f65570aee2aef9243eb23a6ee5a9.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