Skip to content
Snippets Groups Projects
Commit 3c78d5cf authored by Chris Thachuk's avatar Chris Thachuk Committed by Adam Vandenberg
Browse files

Adds support for git submodules. Fixes Homebrew/homebrew#1009.


If submodules exists for a git repo then checkout their index as well
into the appropriate path.

Signed-off-by: default avatarAdam Vandenberg <flangy@gmail.com>
parent d9fe4f00
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment