about summary refs log tree commit diff
path: root/pkgs/build-support/fetchgit/nix-prefetch-git
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/fetchgit/nix-prefetch-git')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 8f8104863e67..e02b2ea7fbc2 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -207,6 +207,9 @@ checkout_ref(){
 
 # Update submodules
 init_submodules(){
+    # shallow with leaveDotGit will change hashes
+    [[ -z "$deepClone" ]] && [[ -z "$leaveDotGit" ]] && \
+    clean_git submodule update --init --recursive -j ${NIX_BUILD_CORES:-1} --progress --depth 1 || \
     clean_git submodule update --init --recursive -j ${NIX_BUILD_CORES:-1} --progress
 }