@@ -159,7 +159,7 @@ function(_alp_add_repo_prepare_submodules name repo_dir revision checkout_perfor
159159 message (STATUS "[alp/git] ${name} : fetching missing recursive submodule revisions in '${repo_dir} '." )
160160 execute_process (
161161 COMMAND "${GIT_EXECUTABLE} " -c protocol.file.allow=always submodule update
162- --init --recursive --checkout --depth 1
162+ --init --recursive --checkout --force -- depth 1
163163 WORKING_DIRECTORY "${repo_dir} "
164164 RESULT_VARIABLE _update_result
165165 OUTPUT_VARIABLE _output
@@ -168,23 +168,6 @@ function(_alp_add_repo_prepare_submodules name repo_dir revision checkout_perfor
168168 _alp_add_repo_fail ("${name} " "${repo_dir} " "${revision} "
169169 "updating recursive submodules" "${_error}${_output} " )
170170 endif ()
171-
172- # A failed --no-fetch pass can leave shallow submodules checked out at
173- # commits other than the gitlinks recorded by their parents. Once the
174- # fallback has fetched every missing object, converge all worktrees
175- # from local objects before checking the repository postconditions.
176- message (STATUS "[alp/git] ${name} : finalizing recursive submodules from local objects in '${repo_dir} '." )
177- execute_process (
178- COMMAND "${GIT_EXECUTABLE} " -c protocol.file.allow=always submodule update
179- --init --recursive --checkout --force --depth 1 --no-fetch
180- WORKING_DIRECTORY "${repo_dir} "
181- RESULT_VARIABLE _finalize_result
182- OUTPUT_VARIABLE _output
183- ERROR_VARIABLE _error )
184- if (NOT _finalize_result EQUAL 0)
185- _alp_add_repo_fail ("${name} " "${repo_dir} " "${revision} "
186- "finalizing recursive submodules" "${_error}${_output} " )
187- endif ()
188171 endif ()
189172endfunction ()
190173
0 commit comments