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: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
d9fe4f00a4
commit
3c78d5cf91
@ -172,6 +172,13 @@ class GitDownloadStrategy <AbstractDownloadStrategy
|
|||||||
end
|
end
|
||||||
# http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
|
# http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
|
||||||
safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/"
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user