aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-02-17 15:43:16 -0600
committerJack Nagel2013-02-17 15:43:16 -0600
commitc7668a73d8c48809d11fdc211aa7e0904eee7906 (patch)
tree676aa5aa8303993c997b711fadcd13e5a2f562f7 /Library/Homebrew
parent18bfb4310b9f33c1dbf9fddbc8f35ceb9e8f0f8d (diff)
downloadhomebrew-c7668a73d8c48809d11fdc211aa7e0904eee7906.tar.bz2
GitDownloadStrategy: factor out checkout args
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/download_strategy.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 6927079ed..8cb429da7 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -411,15 +411,19 @@ class GitDownloadStrategy < AbstractDownloadStrategy
@clone.cd { update_submodules } if submodules?
end
- def checkout
+ def checkout_args
ref = case @spec
when :branch, :tag, :revision then @ref
else `git symbolic-ref refs/remotes/origin/HEAD`.strip.split("/").last
end
- nostdout do
- quiet_safe_system @@git, 'checkout', { :quiet_flag => '-q' }, ref, '--'
- end
+ args = %w{checkout}
+ args << { :quiet_flag => '-q' }
+ args << ref
+ end
+
+ def checkout
+ nostdout { quiet_safe_system @@git, *checkout_args }
end
def update_submodules