aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-02-14 17:29:59 -0600
committerJack Nagel2013-02-14 17:29:59 -0600
commitf2f2fa45db741d2706fde20e0e6c921f39e4261c (patch)
tree681e9348d7263b4c279a75ba547774c0adee3b41 /Library/Homebrew
parentcedca232c27b60313f5f1ff317f605893019933d (diff)
downloadhomebrew-f2f2fa45db741d2706fde20e0e6c921f39e4261c.tar.bz2
GitDownloadStrategy: default to remote HEAD during checkout
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/download_strategy.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 05937b165..cbfb00254 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -377,7 +377,7 @@ class GitDownloadStrategy < AbstractDownloadStrategy
end
def clone_args
- args = %w{clone --no-checkout}
+ args = %w{clone}
args << '--depth' << '1' if support_depth?
case @spec
@@ -408,16 +408,13 @@ class GitDownloadStrategy < AbstractDownloadStrategy
def clone_repo
safe_system @@git, *clone_args
- @clone.cd do
- checkout
- update_submodules if submodules?
- end
+ @clone.cd { update_submodules } if submodules?
end
def checkout
ref = case @spec
- when :branch then "origin/#@ref"
- when :tag, :revision then @ref
+ when :branch, :tag, :revision then @ref
+ else `git symbolic-ref refs/remotes/origin/HEAD`.strip.split("/").last
end
nostdout do