Browse Source

Merge topic 'ExternalProject-fix-remote-branch'

6f3838c0 ExternalProject: Fix regression in GIT_TAG with remote branch name

Acked-by: Kitware Robot <[email protected]>
Merge-request: !649
Brad King 8 years ago
parent
commit
8bc545c24c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Modules/ExternalProject.cmake

+ 4 - 1
Modules/ExternalProject.cmake

@@ -600,8 +600,11 @@ if(error_code)
   message(FATAL_ERROR \"Failed to clone repository: '${git_repository}'\")
 endif()
 
+# Use `git checkout <branch>` even though this risks ambiguity with a
+# local path.  Unfortunately we cannot use `git checkout <tree-ish> --`
+# because that will not search for remote branch names, a common use case.
 execute_process(
-  COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag} --
+  COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag}
   WORKING_DIRECTORY \"${work_dir}/${src_name}\"
   RESULT_VARIABLE error_code
   )