diff options
author | Brad King <brad.king@kitware.com> | 2017-03-31 17:00:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-31 17:00:08 (GMT) |
commit | 1f5ab902087324c6f7e7234965b09c9fa60d639c (patch) | |
tree | 2439b506dbb8a89dfa5a16bd24cc1f10a8c1c423 | |
parent | 9e32b88784e5e0f14258597fde162fcaf6290fea (diff) | |
parent | 6f3838c034e652b90d9c2571851729313880a328 (diff) | |
download | CMake-1f5ab902087324c6f7e7234965b09c9fa60d639c.zip CMake-1f5ab902087324c6f7e7234965b09c9fa60d639c.tar.gz CMake-1f5ab902087324c6f7e7234965b09c9fa60d639c.tar.bz2 |
Merge branch 'ExternalProject-fix-remote-branch' into release
-rw-r--r-- | Modules/ExternalProject.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 00781d6..b42d2dd 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 ) |