mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 12:59:04 +02:00
Merge pull request #130040 from Atemu/nix-prefetch-git-shallow-hash
nix-prefetch-git: don't fetch everything when given a hash
This commit is contained in:
commit
6f18141c6d
|
@ -140,7 +140,7 @@ url_to_name(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fetch everything and checkout the right sha1
|
# Fetch and checkout the right sha1
|
||||||
checkout_hash(){
|
checkout_hash(){
|
||||||
local hash="$1"
|
local hash="$1"
|
||||||
local ref="$2"
|
local ref="$2"
|
||||||
|
@ -149,6 +149,7 @@ checkout_hash(){
|
||||||
hash=$(hash_from_ref "$ref")
|
hash=$(hash_from_ref "$ref")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
clean_git fetch ${builder:+--progress} --depth=1 origin "$hash" || \
|
||||||
clean_git fetch -t ${builder:+--progress} origin || return 1
|
clean_git fetch -t ${builder:+--progress} origin || return 1
|
||||||
|
|
||||||
local object_type=$(git cat-file -t "$hash")
|
local object_type=$(git cat-file -t "$hash")
|
||||||
|
|
Loading…
Reference in a new issue