Only update submodules when recursive is true #7033
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Type:
“Bug Report” / “Bugfix Pull Request”
Ansible Version:
ansible 1.6 (devel a5e7492) last updated 2014/04/15 21:12:13 (GMT -400)
Environment:
Ubuntu 12.04
Summary:
Setting the git recursive parameter to no does not stop a repo with submodules from having all of the submodules cloned. While the
--recursive
flag is added to the clone command , themain
function callsswitch_version
which automatically runssubmodule_update
without checking the recursive parameter.This pull request adds that logic that only updates the submodules when the recursive parameter is set.
Steps To Reproduce:
With a git repo with submodules, run
git: repo=reponame dest=place/to/put/it recursive=no
Expected Results:
I expect my base module to be cloned / pulled, but for none of the submodules contents to be present. The path that the submodules point to should exist, but that should bot have the content from their repos
Actual Results:
Before PR:
All submodules are fully updated, with all contents present.
After PR
Expected Result