Browse Source

ExternalProject: Remove extra quotes in for-each-ref update step

The --format=... argument to git for-each-ref was using a stray pair
of single quotes around the format string. These were then part of
the output, which caused it to never match the checkout_name.
The end result was that a REBASE_CHECKOUT always became a
CHECKOUT in all scenarios.

Fixes: #23216
Craig Scott 3 years ago
parent
commit
dec997f04e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/ExternalProject/gitupdate.cmake.in

+ 1 - 1
Modules/ExternalProject/gitupdate.cmake.in

@@ -128,7 +128,7 @@ if(git_update_strategy MATCHES "^REBASE(_CHECKOUT)?$")
 
   else()
     execute_process(
-      COMMAND "@git_EXECUTABLE@" for-each-ref "--format='%(upstream:short)'" "${current_branch}"
+      COMMAND "@git_EXECUTABLE@" for-each-ref "--format=%(upstream:short)" "${current_branch}"
       WORKING_DIRECTORY "@work_dir@"
       OUTPUT_VARIABLE upstream_branch
       OUTPUT_STRIP_TRAILING_WHITESPACE