Skip to content

Make submodule clones shallow to avoid work. #42208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ci/init_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [ ! -d "$cache_src_dir/.git" ]; then
fi
retry sh -c "cd $cache_src_dir && git reset --hard && git pull"
retry sh -c "cd $cache_src_dir && \
git submodule deinit -f . && git submodule sync && git submodule update --init"
git submodule deinit -f . && git submodule sync && git submodule update --depth 1 --init"

# Cache was updated without errors, mark it as valid
touch "$cache_valid_file"
Expand All @@ -78,9 +78,9 @@ modules="$(git config --file .gitmodules --get-regexp '\.path$' | cut -d' ' -f2)
for module in $modules; do
if [ ! -d "$cache_src_dir/$module" ]; then
echo "WARNING: $module not found in pristine repo"
retry sh -c "git submodule deinit -f $module && git submodule update --init $module"
retry sh -c "git submodule deinit -f $module && git submodule update --depth 1 --init $module"
continue
fi
retry sh -c "git submodule deinit -f $module && \
git submodule update --init --reference $cache_src_dir/$module $module"
git submodule update --init --depth 1 --reference $cache_src_dir/$module $module"
done