diff --git a/pkgs/build-support/fetchgit/builder.sh b/pkgs/build-support/fetchgit/builder.sh index 08a1cc5d3419..e43a2e37726c 100644 --- a/pkgs/build-support/fetchgit/builder.sh +++ b/pkgs/build-support/fetchgit/builder.sh @@ -2,7 +2,7 @@ source $stdenv/setup header "exporting $url (rev $rev) into $out" -git clone "$url" $out +git clone --depth 1 "$url" $out if test -n "$rev"; then cd $out git checkout $rev diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 6e88b1d9c2ff..29b3472596d4 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -36,7 +36,7 @@ if test -z "$finalPath"; then trap "rm -rf $tmpPath" EXIT # Perform the checkout. - git clone "$url" $tmpFile + git clone --depth 1 "$url" $tmpFile if test -n "$rev"; then cd $tmpFile echo $tmpFile