aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-04-01 20:31:17 +0800
committerXu Cheng2015-05-08 15:48:51 +0800
commitfa9371e58e948c284cf8492557b3d1f19e459770 (patch)
treeff7bd50c84e17cb40ee4b8246f0b1d99f6040307 /Library
parent9daeef5d9537f76f24d623f28c513e78f59457ab (diff)
downloadbrew-fa9371e58e948c284cf8492557b3d1f19e459770.tar.bz2
tap: support fast clone
Closes Homebrew/homebrew#37592. Closes Homebrew/homebrew#38268. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/tap.rb6
-rw-r--r--Library/Homebrew/manpages/brew.1.md4
2 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index 34db5a9e4..5e0554dbb 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -20,7 +20,9 @@ module Homebrew
tapd = HOMEBREW_LIBRARY/"Taps/#{user.downcase}/homebrew-#{repo.downcase}"
return false if tapd.directory?
ohai "Tapping #{repouser}/#{repo}"
- abort unless system "git", "clone", "https://github.com/#{repouser}/homebrew-#{repo}", tapd.to_s
+ args = %W[clone https://github.com/#{repouser}/homebrew-#{repo} #{tapd}]
+ args << "--depth=1" unless ARGV.include?("--full")
+ safe_system "git", *args
files = []
tapd.find_formula { |file| files << file }
@@ -109,7 +111,7 @@ module Homebrew
end
end
- def tap_args(tap_name=ARGV.first)
+ def tap_args(tap_name=ARGV.named.first)
tap_name =~ HOMEBREW_TAP_ARGS_REGEX
raise "Invalid tap name" unless $1 && $3
[$1, $3]
diff --git a/Library/Homebrew/manpages/brew.1.md b/Library/Homebrew/manpages/brew.1.md
index c7a2206a4..d22373517 100644
--- a/Library/Homebrew/manpages/brew.1.md
+++ b/Library/Homebrew/manpages/brew.1.md
@@ -345,11 +345,13 @@ Note that these flags should only appear after a command.
* `switch` <name> <version>:
Symlink all of the specific <version> of <name>'s install to Homebrew prefix.
- * `tap` [<tap>]:
+ * `tap` [--full] [<tap>]:
Tap a new formula repository from GitHub, or list existing taps.
<tap> is of the form <user>/<repo>, e.g. `brew tap homebrew/dupes`.
+ If `--full` is passed, a full clone will be used.
+
* `tap --repair`:
Ensure all tapped formulae are symlinked into Library/Formula and prune dead
formulae from Library/Formula.