summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2020-10-17 10:54:51 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-01-16 07:12:00 (GMT)
commitac4a8002a596b00261b148828918926140c520b4 (patch)
treebefd7b3269ee729e2572381514fb0398cc3c0612 /Modules
parentddd9545895326e45bee798ae0b5a5d2bf8dae239 (diff)
downloadCMake-ac4a8002a596b00261b148828918926140c520b4.zip
CMake-ac4a8002a596b00261b148828918926140c520b4.tar.gz
CMake-ac4a8002a596b00261b148828918926140c520b4.tar.bz2
ExternalProject: Don't git stash ignored files
The change to the binary gitrepo.tgz file adds a commit which adds a .gitignore file. Fixes: #21278
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 3307bc6..bb3684a 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1422,10 +1422,13 @@ function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_r
if("${git_tag}" STREQUAL "")
message(FATAL_ERROR "Tag for git checkout should not be empty.")
endif()
- if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.6)
- set(git_stash_save_options --all --quiet)
- else()
- set(git_stash_save_options --quiet)
+ set(git_stash_save_options --quiet)
+ if(GIT_VERSION_STRING VERSION_GREATER_EQUAL 1.7.7)
+ # This avoids stashing files covered by .gitignore
+ list(APPEND git_stash_save_options --include-untracked)
+ elseif(GIT_VERSION_STRING VERSION_GREATER_EQUAL 1.7.6)
+ # Untracked files, but also ignored files, so potentially slower
+ list(APPEND git_stash_save_options --all)
endif()
configure_file(