diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index b457fd927..a265e0b35 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -311,7 +311,7 @@ class GitDownloadStrategy < AbstractDownloadStrategy Dir.chdir(@clone) do # Check for interupted clone from a previous install unless system 'git', 'status', '-s' - ohai "Removing invalid .git repo from cache" + puts "Removing invalid .git repo from cache" FileUtils.rm_rf @clone end end @@ -328,7 +328,6 @@ class GitDownloadStrategy < AbstractDownloadStrategy Dir.chdir(@clone) do safe_system 'git', 'remote', 'set-url', 'origin', @url quiet_safe_system 'git', 'fetch', 'origin' - # If we're going to checkout a tag, then we need to fetch new tags too. quiet_safe_system 'git', 'fetch', '--tags' if @spec == :tag end end @@ -345,6 +344,10 @@ class GitDownloadStrategy < AbstractDownloadStrategy when :tag nostdout { quiet_safe_system 'git', 'checkout', @ref } end + else + # otherwise the checkout-index won't checkout HEAD + # https://github.com/mxcl/homebrew/issues/7124 + quiet_safe_system "git", "reset", "--hard" end # http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/" |
