From 145647fc45fc5b9f3cf23a91c3b2b5f48789421a Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 17 Feb 2013 15:43:16 -0600 Subject: [PATCH] GitDownloadStrategy: factor out checkout args --- Library/Homebrew/download_strategy.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 6927079edd..8cb429da7a 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