summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-03 13:26:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-03 13:26:53 (GMT)
commit8bc545c24c8b22250150e03abfaff880a1403266 (patch)
treefd81ec60937b0325cf82c4ad0804491fe1305329 /Modules/ExternalProject.cmake
parent1e83154f08805ca761e53471f571d93060057653 (diff)
parent6f3838c034e652b90d9c2571851729313880a328 (diff)
downloadCMake-8bc545c24c8b22250150e03abfaff880a1403266.zip
CMake-8bc545c24c8b22250150e03abfaff880a1403266.tar.gz
CMake-8bc545c24c8b22250150e03abfaff880a1403266.tar.bz2
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 97438e6..34dc98c 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
)