Allow shallow clones to be explicitly disabled

Fixes #25751