aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-10-24 18:51:02 -0700
committerCharlie Sharpsteen2011-10-24 18:55:43 -0700
commitc6dcd8a16471877c9a7e4c1b9a835fe648fdb5f9 (patch)
treeb9cea6b212b29940058a81279a13d50874aab177 /Library
parent68abb246252689208b3b687fc7cbfa6e3d48b9e7 (diff)
downloadhomebrew-c6dcd8a16471877c9a7e4c1b9a835fe648fdb5f9.tar.bz2
brew-pull: Add flag to suppress whitespace fixes
When the pull request includes a patch, fixing whitespace can break the patch.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-pull.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Contributions/examples/brew-pull.rb b/Library/Contributions/examples/brew-pull.rb
index de54fd529..3ff655b99 100755
--- a/Library/Contributions/examples/brew-pull.rb
+++ b/Library/Contributions/examples/brew-pull.rb
@@ -13,7 +13,7 @@ if ARGV.empty?
end
HOMEBREW_REPOSITORY.cd do
- ARGV.each do|arg|
+ ARGV.named.each do|arg|
if arg.to_i > 0
url = 'https://github.com/mxcl/homebrew/pull/' + arg + '.patch'
else
@@ -38,13 +38,17 @@ HOMEBREW_REPOSITORY.cd do
# Makes sense to squash whitespace errors, we don't want them.
ohai 'Applying patch'
- safe_system 'git', 'am', '--signoff', '--whitespace=fix', patchpath
+ patch_args = %w[am --signoff]
+ patch_args << '--whitespace=fix' unless ARGV.include? '--ignore-whitespace'
+ patch_args << patchpath
+
+ safe_system 'git', *patch_args
issue = arg.to_i > 0 ? arg.to_i : urlmatch[2]
if issue
ohai "Patch closes issue ##{issue}"
message = `git log HEAD^.. --format=%B`
-
+
# If this is a pull request, append a close message.
if !message.include? 'Closes #'
issueline = "Closes ##{issue}."