diff options
author | Nate Avers <nathan.avers@alumni.case.edu> | 2020-07-24 02:25:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-24 13:39:06 (GMT) |
commit | 8dbefc3ca6ab7043efb85bcfb6b53aa22c31b1df (patch) | |
tree | ca4a44de7dff99492415d222b1e1c0f783342d6c | |
parent | d421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff) | |
download | CMake-8dbefc3ca6ab7043efb85bcfb6b53aa22c31b1df.zip CMake-8dbefc3ca6ab7043efb85bcfb6b53aa22c31b1df.tar.gz CMake-8dbefc3ca6ab7043efb85bcfb6b53aa22c31b1df.tar.bz2 |
ExternalProject: omit --no-checkout from git clone when using git 2.20.x.
The optimization from commit 627fc5b44f (ExternalProject: Avoid
unnecessary checkout on clone, 2019-07-29, v3.16.0-rc1~325^2) triggers a
bug in the Git 2.20.x series that is not in older or newer versions.
Drop the optimization for that specific range of Git versions.
Fixes: #21009
-rw-r--r-- | Modules/ExternalProject.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 3a47090..aecc00b 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1124,7 +1124,11 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git message(FATAL_ERROR "Tag for git checkout should not be empty.") endif() - set(git_clone_options "--no-checkout") + if(GIT_VERSION_STRING VERSION_LESS 2.20 OR 2.21 VERSION_LESS_EQUAL GIT_VERSION_STRING) + set(git_clone_options "--no-checkout") + else() + set(git_clone_options) + endif() if(git_shallow) if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.10) list(APPEND git_clone_options "--depth 1 --no-single-branch") |