File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function(check_submodule_commit name rel_path)
3636 RESULT_VARIABLE _rc)
3737
3838 if (_rc OR "${_baseline} " STREQUAL "" )
39- message (FATAL_ERROR "Could not query git-link for ${rel_path} : ${_err} " )
39+ message (STATUS "Could not query git-link for ${rel_path} : ${_err} . Skipping Submodule Version Check. " )
4040 endif ()
4141
4242 # ensure the commit object exists (deepens shallow clones/branches)
@@ -60,12 +60,25 @@ function(check_submodule_commit name rel_path)
6060 execute_process (COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD
6161 WORKING_DIRECTORY "${_sub_dir} "
6262 OUTPUT_VARIABLE _head
63- OUTPUT_STRIP_TRAILING_WHITESPACE)
63+ OUTPUT_STRIP_TRAILING_WHITESPACE
64+ ERROR_VARIABLE _err
65+ RESULT_VARIABLE _rc ERROR_QUIET)
66+
67+ if (_rc)
68+ message (STATUS "Could not get HEAD commit for ${name} : ${_err} . Skipping Submodule Version Check." )
69+ return ()
70+ endif ()
6471
6572 execute_process (COMMAND ${GIT_EXECUTABLE} merge-base --is-ancestor
6673 ${_baseline} ${_head}
6774 WORKING_DIRECTORY "${_sub_dir} "
6875 RESULT_VARIABLE _is_anc ERROR_QUIET)
76+
77+ # Check if merge-base command failed (not just ancestry check)
78+ if (_is_anc EQUAL -1)
79+ message (WARNING "Could not determine ancestry for ${name} at ${_sub_dir} " )
80+ return ()
81+ endif ()
6982
7083 if (_is_anc GREATER 0)
7184 message (FATAL_ERROR
You can’t perform that action at this time.
0 commit comments