summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-01 11:49:07 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-01 11:49:14 (GMT)
commit6f5f87966b42aa1c7d16fac8753072bd9ae2434e (patch)
treed55aa96aa255635d6517992dc35808bd42acc55d /Tests
parente773892ccb3ed2b23cc7760dc7e7e15256fa25dd (diff)
parent8aa4d51ec5695777168dcea02113482bf02e307f (diff)
downloadCMake-6f5f87966b42aa1c7d16fac8753072bd9ae2434e.zip
CMake-6f5f87966b42aa1c7d16fac8753072bd9ae2434e.tar.gz
CMake-6f5f87966b42aa1c7d16fac8753072bd9ae2434e.tar.bz2
Merge topic 'fc-ep-git-update-strategy'
8aa4d51ec5 ExternalProject: Add missing release note for git update strategy 1236590507 FetchContent: Pass through CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY if set e71c2807ba ExternalProject: Remote checkout needs to include the remote name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4818
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index ba0c598..ddc513f 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -199,8 +199,14 @@ if(do_git_tests)
foreach(strategy IN ITEMS CHECKOUT REBASE_CHECKOUT)
# Move local master back, then apply a change that will cause a conflict
- # during rebase. We want to test the fallback to checkout.
- check_a_tag(master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
+ # during rebase
+ execute_process(COMMAND ${GIT_EXECUTABLE} checkout master
+ WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ message(FATAL_ERROR "Could not reset local master back to tag1.")
+ endif()
execute_process(COMMAND ${GIT_EXECUTABLE} reset --hard tag1
WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
RESULT_VARIABLE error_code
@@ -208,6 +214,7 @@ if(do_git_tests)
if(error_code)
message(FATAL_ERROR "Could not reset local master back to tag1.")
endif()
+
set(cmlFile ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT/CMakeLists.txt)
file(READ ${cmlFile} contents)
string(REPLACE "find TutorialConfig.h" "find TutorialConfig.h (conflict here)"
@@ -222,7 +229,7 @@ if(do_git_tests)
message(FATAL_ERROR "Could not commit conflicting change.")
endif()
# This should discard our commit but leave behind an annotated tag
- check_a_tag(master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 ${strategy})
+ check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 ${strategy})
endforeach()
endif()