Skip to content

ExternalProject: Use ${ref}^0 to avoid MSYS/Cygwin shell substitutions

Craig Scott requested to merge craig.scott/cmake:ep-git-update-commit-ref into master

In 5e941a54 (ExternalProject: Ensure git fetch if updating to hash we don't have yet, 2021-05-09), the form ${ref}^{commit} was used to ensure the ref was treated as a commit. When running under a MSYS2 or Cygwin shell, the {commit} part can be translated by the shell, leaving it as ${ref}^commit, which git doesn't understand. Use the equivalent but safer form ${ref}^0, since it won't be subject to the shell substitution issue.

Fixes: #22299 (closed)
Backport: release

Merge request reports