aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2015-01-15 11:11:24 +0000
committerMike McQuaid2015-01-15 11:15:13 +0000
commitdac4848661ab65452ffc950d6c74b4212c37a51b (patch)
treea9b174f03b8e032d6c311b51acc2ab6dd00ff4dc /Library
parent53d848e364f9531fd6e1da797af03b24ddea531e (diff)
downloadbrew-dac4848661ab65452ffc950d6c74b4212c37a51b.tar.bz2
pull: merge and rebase when pulling bottles.
This seems to be a more robust approach when a PR has multiple commits.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/pull.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index b6725f7fb..8294f0493 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -85,8 +85,9 @@ module Homebrew
# The cache directory seems like a good place to put patches.
HOMEBREW_CACHE.mkpath
- # Store current revision
+ # Store current revision and branch
revision = `git rev-parse --short HEAD`.strip
+ branch = `git symbolic-ref --short HEAD`.strip
pull_url url
@@ -139,11 +140,17 @@ 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}"
else
pull_url "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}"
end
+ safe_system "git", "rebase", branch
+ safe_system "git", "checkout", branch
+ safe_system "git", "merge", "--ff-only", "--no-edit", bottle_branch
+ safe_system "git", "branch", "-D", bottle_branch
end
ohai 'Patch changed:'