From eaf82ba09b441852bf280782fd6b4ffb94c35069 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 14 Feb 2015 16:32:24 -0500 Subject: [PATCH] Stage entire git repo into build directory Closes Homebrew/homebrew#27193. --- Library/Homebrew/download_strategy.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 40f0504a0e..9406cc9325 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -537,13 +537,7 @@ class GitDownloadStrategy < VCSDownloadStrategy def stage super - - dst = Dir.getwd - cached_location.cd do - # https://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export - safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/" - checkout_submodules(dst) if submodules? - end + cp_r File.join(cached_location, "."), Dir.pwd end private @@ -649,12 +643,6 @@ class GitDownloadStrategy < VCSDownloadStrategy quiet_safe_system "git", "submodule", "foreach", "--recursive", "git submodule sync" quiet_safe_system "git", "submodule", "update", "--init", "--recursive" end - - def checkout_submodules(dst) - escaped_clone_path = cached_location.to_s.gsub(/\//, '\/') - sub_cmd = %[git checkout-index -a -f --prefix="#{dst}/${toplevel/#{escaped_clone_path}/}/$path/"] - quiet_safe_system "git", "submodule", "foreach", "--recursive", sub_cmd - end end class CVSDownloadStrategy < VCSDownloadStrategy