diff options
| author | Charlie Sharpsteen | 2011-10-24 18:51:02 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-10-24 18:55:43 -0700 |
| commit | d54e7fb4deb98b5572fcdf9a55eba702a2a10f52 (patch) | |
| tree | 6a6453ea35b463b0a69401e4a6f2a390f88fcd2e /Library/Contributions/examples | |
| parent | cbdb6038387cf293febcc14bdf5326eb5f38e63e (diff) | |
| download | brew-d54e7fb4deb98b5572fcdf9a55eba702a2a10f52.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/Contributions/examples')
| -rwxr-xr-x | Library/Contributions/examples/brew-pull.rb | 10 |
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}." |
