Skip to content

Commit

Permalink
added variable to be able to turn off recursive submodules update
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed Jun 22, 2011
1 parent a5d2e4c commit 1ffcb85
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/capistrano/recipes/deploy/scm/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ def checkout(revision, destination)
if variable(:git_enable_submodules)
execute << "#{git} submodule #{verbose} init"
execute << "#{git} submodule #{verbose} sync"
execute << "#{git} submodule #{verbose} update --init --recursive"
if false == variable(:git_submodules_recursive)
execute << "#{git} submodule #{verbose} update --init"
else
execute << "#{git} submodule #{verbose} update --init --recursive"
end
end

execute.join(" && ")
Expand Down Expand Up @@ -187,7 +191,11 @@ def sync(revision, destination)
execute << "#{git} submodule #{verbose} init"
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 --init --recursive"
if false == variable(:git_submodules_recursive)
execute << "#{git} submodule #{verbose} update --init"
else
execute << "#{git} submodule #{verbose} update --init --recursive"
end
end

# Make sure there's nothing else lying around in the repository (for
Expand Down

0 comments on commit 1ffcb85

Please sign in to comment.