Skip to content
Snippets Groups Projects
Commit 360ff17d authored by Craig Scott's avatar Craig Scott
Browse files

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

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
parent acd82e46
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5)
function(get_hash_for_ref ref out_var err_var)
execute_process(
COMMAND "@git_EXECUTABLE@" rev-parse "${ref}^{commit}"
COMMAND "@git_EXECUTABLE@" rev-parse "${ref}^0"
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
OUTPUT_VARIABLE ref_hash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment