Merge pull request #238733 from domenkozar/fetchgit-submodules-parallel

fetchgit: fetch submodules in parallel

authored by Domen Kožar and committed by GitHub b51a5364 9438752b

+1 -21
+1 -21
pkgs/build-support/fetchgit/nix-prefetch-git
··· 206 206 207 207 # Update submodules 208 208 init_submodules(){ 209 - # Add urls into .git/config file 210 - clean_git submodule init 211 - 212 - # list submodule directories and their hashes 213 - git submodule status | 214 - while read -r l; do 215 - local hash 216 - local dir 217 - local name 218 - local url 219 - 220 - # checkout each submodule 221 - hash=$(echo "$l" | awk '{print $1}' | tr -d '-') 222 - dir=$(echo "$l" | sed -n 's/^.[0-9a-f]\+ \(.*[^)]*\)\( (.*)\)\?$/\1/p') 223 - name=$( 224 - git config -f .gitmodules --get-regexp submodule\..*\.path | 225 - sed -n "s,^\(.*\)\.path $dir\$,\\1,p") 226 - url=$(git config --get "${name}.url") 227 - 228 - clone "$dir" "$url" "$hash" "" 229 - done 209 + clean_git submodule update --init --recursive -j $NIX_BUILD_CORES 230 210 } 231 211 232 212 clone(){