Skip to content

ExternalProject: Avoid unnecessary checkout on clone

Tetragramm requested to merge Tetragramm/cmake:2xCheckout_Attempt2 into master

ExternalProject_Add checks out the HEAD, and then immediately overwrites it with the desired GIT_TAG.

This requires extra time, to check out a (potentially large) HEAD, extra bandwidth to download it, and is a potential failure point, if the HEAD has issues. For example, a particularly long file path that goes over the OS's limit (Thank you Windows 7).

Tell git not to perform a checkout on clone, since the very next command is to perform a checkout of the desired target. This may also help with Issue #17770.

To the best of my research, this should have no negative side-effects, but if someone more familiar with git says it will, I would trust them. As evidenced by the way I messed up the last merge request.

Topic-rename: ExternalProject-avoid-extra-checkout

Edited by Kitware Robot

Merge request reports