@@ -302,13 +302,22 @@ define define_module =
302302 echo -n '$($1_repo ) |$($1_commit_hash ) ' > "$$@ "; \
303303 elif [ "$$$$(cat "$$@ " ) " != '$($1_repo ) |$($1_commit_hash ) ' ]; then \
304304 echo "Switching $1 to $($1_repo ) at $($1_commit_hash ) " && \
305- git -C "$(build ) /$($1_base_dir ) " reset --hard HEAD^ && \
306- git -C "$(build ) /$($1_base_dir ) " remote set-url origin $($1_repo ) && \
307- git -C "$(build ) /$($1_base_dir ) " checkout origin > /dev/null 2>&1 && \
308- git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) && \
305+ echo "# ####### git clean" && \
309306 git -C "$(build)/$($1_base_dir)" clean -df && \
310307 git -C "$(build)/$($1_base_dir)" clean -dffx payloads util/cbmem && \
308+ echo "######## git submodule foreach clean" && \
309+ git -C "$(build)/$($1_base_dir)" submodule foreach --recursive git clean -df && \
310+ echo "######## git reset --hard HEAD^" && \
311+ git -C "$(build)/$($1_base_dir)" reset --hard HEAD^ && \
312+ echo "######## git submodule foreach reset --hard HEAD^" && \
313+ git -C "$(build)/$($1_base_dir)" submodule foreach --recursive git reset --hard HEAD^ && \
314+ echo "######## git fetch" && \
315+ git -C "$(build)/$($1_base_dir)" fetch $($1_repo) $($1_commit_hash) --recurse-submodules=no && \
316+ echo "######## git reset --hard $($1_commit_hash)" && \
317+ git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash) && \
318+ echo "######## git submodule sync" && \
311319 git -C "$(build)/$($1_base_dir)" submodule sync && \
320+ echo "######## git submodule update" && \
312321 git -C "$(build)/$($1_base_dir)" submodule update --init --checkout && \
313322 echo -n '$($1_repo)|$($1_commit_hash)' > "$$@"; \
314323 fi
0 commit comments