diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2021-07-17 14:29:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 14:29:01 +0100 |
commit | 6f18141c6dca723ad3751d79d5fef0c6cb39bf1b (patch) | |
tree | 6514a2f0205fdc663f02f9abc3d52fff41b2c84c /pkgs | |
parent | c44559aee82b6221ec2eb3892b6cdcbd1a1002f7 (diff) | |
parent | 11df41199ba8a1497d8530dbf478ef10147a93bb (diff) | |
download | nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.tar nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.tar.gz nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.tar.bz2 nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.tar.lz nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.tar.xz nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.tar.zst nixpkgs-6f18141c6dca723ad3751d79d5fef0c6cb39bf1b.zip |
Merge pull request #130040 from Atemu/nix-prefetch-git-shallow-hash
nix-prefetch-git: don't fetch everything when given a hash
Diffstat (limited to 'pkgs')
-rwxr-xr-x | pkgs/build-support/fetchgit/nix-prefetch-git | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 661e0d674c5..8110d670e41 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -140,7 +140,7 @@ url_to_name(){ fi } -# Fetch everything and checkout the right sha1 +# Fetch and checkout the right sha1 checkout_hash(){ local hash="$1" local ref="$2" @@ -149,6 +149,7 @@ checkout_hash(){ hash=$(hash_from_ref "$ref") fi + clean_git fetch ${builder:+--progress} --depth=1 origin "$hash" || \ clean_git fetch -t ${builder:+--progress} origin || return 1 local object_type=$(git cat-file -t "$hash") |