diff options
| author | Max Howell | 2009-11-09 18:24:36 +0000 |
|---|---|---|
| committer | Max Howell | 2009-11-09 18:24:36 +0000 |
| commit | 0618d3c576ee2a5a0e3102d06f49371f2a09b42e (patch) | |
| tree | e86b2faa524358f61adfea20f4f1e8f56a8a9a37 /Library | |
| parent | a5385803691189fe775078172399541ee6475cf5 (diff) | |
| download | homebrew-0618d3c576ee2a5a0e3102d06f49371f2a09b42e.tar.bz2 | |
Ignore stdout during GitDownloadStrategy.stage
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 6 | ||||
| -rwxr-xr-x | Library/Homebrew/test/unittest.rb | 15 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 15 |
3 files changed, 18 insertions, 18 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 56012e185..f69c9f57c 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -140,7 +140,7 @@ class GitDownloadStrategy <AbstractDownloadStrategy safe_system 'git', 'clone', @url, @clone else # TODO git pull? - puts "Repository already cloned" + puts "Repository already cloned to #{@clone}" end end def stage @@ -150,9 +150,9 @@ class GitDownloadStrategy <AbstractDownloadStrategy ohai "Checking out #{@spec} #{@ref}" case @spec when :branch - safe_system 'git', 'checkout', "origin/#{@ref}" + nostdout { safe_system 'git', 'checkout', "origin/#{@ref}" } when :tag - safe_system 'git', 'checkout', @ref + nostdout { safe_system 'git', 'checkout', @ref } end end # http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb index 90d9ecdbc..d611ce234 100755 --- a/Library/Homebrew/test/unittest.rb +++ b/Library/Homebrew/test/unittest.rb @@ -136,21 +136,6 @@ class RefreshBrewMock < RefreshBrew end end -def nostdout - if ARGV.include? '-V' - yield - end - begin - require 'stringio' - tmpo=$stdout - tmpe=$stderr - $stdout=StringIO.new - yield - ensure - $stdout=tmpo - end -end - module ExtendArgvPlusYeast def reset @named = nil diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index d980c328c..6ef48ad31 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -159,3 +159,18 @@ def ignore_interrupts ensure trap("INT", std_trap) end + +def nostdout + if ARGV.verbose? + yield + else + begin + require 'stringio' + real_stdout = $stdout + $stdout = StringIO.new + yield + ensure + $stdout = real_stdout + end + end +end
\ No newline at end of file |
