GIT_STRATEGY fetch does not correctly update submodule tags
- git submodule update doesn't fetch anything if your submodules are up-to-date
- So when using the GIT_STRATEGY fetch and the runner already checked out the submodule at the same commit, nothing ist done
- If, however, somebody pushed a tag in the meantime to the submodule, the runner will not pick up that tag
The solution could be:
git submodule foreach --recursive 'git fetch --tags'
maybe even with -f
for force-pushed tags? Otherwise, they will fail!
Relevant links:
- The foreach trick: https://stackoverflow.com/a/12284659/1531708
- A hint to the "no fetch if up-to-date" problem from the same SO question as above: https://stackoverflow.com/a/7504682/1531708
- Insights into different behaviors of
--tags
in conjunction with fetch or pull: https://stackoverflow.com/a/20608181/1531708
Proposal
To do this we need to update writeSubmoduleUpdateCmd
to call for the tags.
Edited by Steve Xuereb