diff options
| author | Xu Cheng | 2015-06-13 01:57:00 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-06-14 21:28:36 +0800 |
| commit | 4101cef3c5e167daee6a6189e34546619c510dd3 (patch) | |
| tree | dcdb048f7fac8c88a8b2605168ba8e6d66841256 /Library/Homebrew/cmd | |
| parent | b88cb13718357c26a10fa1ac68d630225c7791fb (diff) | |
| download | brew-4101cef3c5e167daee6a6189e34546619c510dd3.tar.bz2 | |
Tap: make remote a separate method to reduce initial overhead
Also make remote method only response to installed tap.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/tap-info.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/tap.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index e05b9eb08..cd3f82109 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -48,7 +48,7 @@ module Homebrew info += "Not installed" end puts info - puts "From: #{tap.remote}" + puts "From: #{tap.remote.nil? ? "N/A" : tap.remote}" end end end diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 3a0a1156b..43e47711e 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -14,10 +14,11 @@ module Homebrew end def install_tap user, repo, clone_target=nil - tap = Tap.new user, repo, clone_target + tap = Tap.new user, repo return false if tap.installed? ohai "Tapping #{tap}" - args = %W[clone #{tap.remote} #{tap.path}] + remote = clone_target || "https://github.com/#{tap.user}/homebrew-#{tap.repo}" + args = %W[clone #{remote} #{tap.path}] args << "--depth=1" unless ARGV.include?("--full") safe_system "git", *args |
