aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Thachuk2010-04-07 14:54:30 -0700
committerAdam Vandenberg2010-04-08 11:26:38 -0700
commit8933132d1bf1b55a38f9a8c58d55660f72004e6e (patch)
tree1cf807304c8f9a3aa41470648413478ca574986d
parentaadadbb4bfbeaf3618235605d4daeff5ae79923a (diff)
downloadhomebrew-8933132d1bf1b55a38f9a8c58d55660f72004e6e.tar.bz2
Adds support for git submodules. Fixes #1009.
If submodules exists for a git repo then checkout their index as well into the appropriate path. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
-rw-r--r--Library/Homebrew/download_strategy.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 0305bf944..5f1a1a2d3 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -172,6 +172,13 @@ class GitDownloadStrategy <AbstractDownloadStrategy
end
# http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/"
+ # check for submodules
+ if File.exist?('.gitmodules')
+ safe_system 'git', 'submodule', 'init'
+ safe_system 'git', 'submodule', 'update'
+ sub_cmd = "git checkout-index -a -f --prefix=#{dst}/$path/"
+ safe_system 'git', 'submodule', '--quiet', 'foreach', '--recursive', sub_cmd
+ end
end
end
end