aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2016-04-03 00:07:32 +0800
committerXu Cheng2016-04-03 00:10:41 +0800
commitc8fed576cb896fd4523ebca9fdf7a78dce0087a0 (patch)
tree8e5bb100930ea47dae40f4b08b6f2179371cd99e
parent591ef25442a0b5d085a3f682eb283fdb2e70c560 (diff)
downloadbrew-c8fed576cb896fd4523ebca9fdf7a78dce0087a0.tar.bz2
pull: auto fix legacy closes message
-rw-r--r--Library/Homebrew/cmd/pull.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index e73ead192..eefda3136 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -310,8 +310,15 @@ module Homebrew
patch_args << "-p2" if ARGV.include?("--legacy")
patch_args << patchpath
+ start_revision = `git rev-parse HEAD`.strip
+
begin
safe_system "git", "am", *patch_args
+ if ARGV.include?("--legacy")
+ safe_system "git", "filter-branch", "-f", "--msg-filter",
+ "sed -E -e \"s/ (#[0-9]+)/ Homebrew\\/homebrew\\1/g\"",
+ "#{start_revision}..HEAD"
+ end
rescue ErrorDuringExecution
if ARGV.include? "--resolve"
odie "Patch failed to apply: try to resolve it."