From 2ef79d1387745945e8bb06c98f4407bccf52f859 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 14 Feb 2013 17:29:59 -0600 Subject: [PATCH] GitDownloadStrategy: default to remote HEAD during checkout --- Library/Homebrew/download_strategy.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 05937b1656..cbfb002542 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