1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

"Manually" syncing submodules in .git/config

This commit is contained in:
Nolan Eakins 2009-05-13 13:17:56 -04:00
parent 0def477a8c
commit a6b2a20afd
2 changed files with 6 additions and 1 deletions

View file

@ -189,7 +189,8 @@ module Capistrano
if configuration[:git_enable_submodules]
execute << "#{git} submodule #{verbose} init"
execute << "#{git} submodule sync"
execute << "for mod in `#{git} submodule status | awk '{ print $2 }'`; do #{git} config -f .git/config submodule.${mod}.url `#{git} config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done"
execute << "#{git} submodule #{verbose} sync"
execute << "#{git} submodule #{verbose} update"
end

View file

@ -98,6 +98,10 @@ class DeploySCMGitTest < Test::Unit::TestCase
git = "/opt/local/bin/git"
@config[:scm_command] = git
assert_equal "cd #{dest} && #{git} fetch -q origin && #{git} reset -q --hard #{rev}", @source.sync(rev, dest)
# with submodules
@config[:git_enable_submodules] = true
assert_equal "cd #{dest} && #{git} fetch -q origin && #{git} reset -q --hard #{rev} && #{git} submodule -q init && for mod in `#{git} submodule status | awk '{ print $2 }'`; do #{git} config -f .git/config submodule.${mod}.url `#{git} config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done && #{git} submodule -q sync && #{git} submodule -q update", @source.sync(rev, dest)
end
def test_sync_with_remote