aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-10-24 18:51:02 -0700
committerCharlie Sharpsteen2011-10-24 18:55:43 -0700
commitd54e7fb4deb98b5572fcdf9a55eba702a2a10f52 (patch)
tree6a6453ea35b463b0a69401e4a6f2a390f88fcd2e
parentcbdb6038387cf293febcc14bdf5326eb5f38e63e (diff)
downloadbrew-d54e7fb4deb98b5572fcdf9a55eba702a2a10f52.tar.bz2
brew-pull: Add flag to suppress whitespace fixes
When the pull request includes a patch, fixing whitespace can break the patch.
-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}."