From 258c4ddefe60f65570aee2aef9243eb23a6ee5a9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 19 Feb 2015 10:55:42 +0000 Subject: [PATCH] pull: check bottle commit URL before branching. Otherwise we annoyingly end up on a branch unnecessarily. --- Library/Homebrew/cmd/pull.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb index 25abd91871..5ab329f73f 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_commit_url = if tap_name + "https://github.com/BrewTestBot/homebrew-#{tap_name}/compare/homebrew:master...pr-#{issue}" + else + "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 - if tap_name - pull_url "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}" - end + 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