aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-11-09 18:24:36 +0000
committerMax Howell2009-11-09 18:24:36 +0000
commit04f3ddeac01b75c66ec8e8f83a517cc13b6d3ab9 (patch)
tree21aab0f53457fb844bb86708698b7812172afc71
parent75c7c942a176b8d2b51335b49e3829694ed44340 (diff)
downloadbrew-04f3ddeac01b75c66ec8e8f83a517cc13b6d3ab9.tar.bz2
Ignore stdout during GitDownloadStrategy.stage
-rw-r--r--Library/Homebrew/download_strategy.rb6
-rwxr-xr-xLibrary/Homebrew/test/unittest.rb15
-rw-r--r--Library/Homebrew/utils.rb15
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