summaryrefslogtreecommitdiff
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-03 13:26:49 +0000
committerKitware Robot <kwrobot@kitware.com>2017-04-03 09:26:53 -0400
commit8bc545c24c8b22250150e03abfaff880a1403266 (patch)
treefd81ec60937b0325cf82c4ad0804491fe1305329 /Modules/ExternalProject.cmake
parent1e83154f08805ca761e53471f571d93060057653 (diff)
parent6f3838c034e652b90d9c2571851729313880a328 (diff)
downloadcmake-8bc545c24c8b22250150e03abfaff880a1403266.tar.gz
Merge topic 'ExternalProject-fix-remote-branch'
6f3838c0 ExternalProject: Fix regression in GIT_TAG with remote branch name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !649
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 97438e638c..34dc98c391 100644
--- a/Modules/ExternalProject.cmake
+++ b/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
)