summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2015-09-17 09:41:07 (GMT)
committerDaniele E. Domenichelli <daniele.domenichelli@iit.it>2015-09-17 10:05:07 (GMT)
commit7c5b6ed5c851266b4f6dae5ef864509627acdaf8 (patch)
treec1f402640438f32664909e7959fadb18d3a61d7a /Modules
parentb04c38159eb4db35770f541f7671fe33a3f32bc2 (diff)
downloadCMake-7c5b6ed5c851266b4f6dae5ef864509627acdaf8.zip
CMake-7c5b6ed5c851266b4f6dae5ef864509627acdaf8.tar.gz
CMake-7c5b6ed5c851266b4f6dae5ef864509627acdaf8.tar.bz2
ExternalProject: Use "git stash save --all" only if supported (#15722)
The --all option for git-stash wasn't introduced until git version 1.7.6.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index db61d23..90ceedf 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -646,6 +646,11 @@ endfunction()
function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_submodules git_repository work_dir)
+ if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.6)
+ set(git_stash_save_options --all --quiet)
+ else()
+ set(git_stash_save_options --quiet)
+ endif()
file(WRITE ${script_filename}
"if(\"${git_tag}\" STREQUAL \"\")
message(FATAL_ERROR \"Tag for git checkout should not be empty.\")
@@ -724,7 +729,7 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"
# perform git pull --rebase
if(need_stash)
execute_process(
- COMMAND \"${git_EXECUTABLE}\" stash save --all --quiet
+ COMMAND \"${git_EXECUTABLE}\" stash save ${git_stash_save_options}
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)