mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
ExternalProject: Always do a git fetch for a remote ref.
Remote git refs always require a git fetch, because the remote may move around where the ref points.
This commit is contained in:
committed by
Brad King
parent
2619f4d87a
commit
9b66c8faf5
@@ -29,12 +29,12 @@ macro(check_a_tag desired_tag resulting_sha)
|
||||
WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
|
||||
RESULT_VARIABLE error_code
|
||||
OUTPUT_VARIABLE tag_sha
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Could not check the sha.")
|
||||
endif()
|
||||
|
||||
string(STRIP "${tag_sha}" tag_sha)
|
||||
if(NOT (${tag_sha} STREQUAL ${resulting_sha}))
|
||||
message(FATAL_ERROR "UPDATE_COMMAND produced
|
||||
${tag_sha}
|
||||
@@ -55,4 +55,6 @@ if(GIT_EXECUTABLE)
|
||||
check_a_tag(tag2 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
|
||||
check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a)
|
||||
check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
|
||||
# This is a remote symbolic ref, so it will always trigger a 'git fetch'
|
||||
check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user