mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
unstableGitUpdater: Support non-shallow clones in tag search
This commit is contained in:
parent
222da55eef
commit
460374eb04
@ -80,17 +80,25 @@ let
|
|||||||
commit_sha="$(${git}/bin/git show -s --pretty='format:%H')"
|
commit_sha="$(${git}/bin/git show -s --pretty='format:%H')"
|
||||||
last_tag=""
|
last_tag=""
|
||||||
if [[ -z "$hardcode_zero_version" ]]; then
|
if [[ -z "$hardcode_zero_version" ]]; then
|
||||||
depth=100
|
if [[ "$shallow_clone" == "1" ]]; then
|
||||||
while (( $depth < 10000 )); do
|
depth=100
|
||||||
last_tag="$(${git}/bin/git describe --tags --abbrev=0 2> /dev/null || true)"
|
while (( $depth < 10000 )); do
|
||||||
if [[ -n "$last_tag" ]]; then
|
last_tag="$(${git}/bin/git describe --tags --abbrev=0 2> /dev/null || true)"
|
||||||
break
|
if [[ -n "$last_tag" ]]; then
|
||||||
fi
|
break
|
||||||
${git}/bin/git fetch --depth="$depth" --tags
|
fi
|
||||||
depth=$(( $depth * 2 ))
|
${git}/bin/git fetch --depth="$depth" --tags
|
||||||
done
|
depth=$(( $depth * 2 ))
|
||||||
|
done
|
||||||
|
else
|
||||||
|
last_tag="$(${git}/bin/git describe --tags --abbrev=0 2> /dev/null || true)"
|
||||||
|
fi
|
||||||
if [[ -z "$last_tag" ]]; then
|
if [[ -z "$last_tag" ]]; then
|
||||||
echo "Cound not find a tag within last 10000 commits" > /dev/stderr
|
if [[ "$shallow_clone" == "1" ]]; then
|
||||||
|
echo "Cound not find a tag within last 10000 commits" > /dev/stderr
|
||||||
|
else
|
||||||
|
echo "Cound not find a tag" > /dev/stderr
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ -n "$tag_prefix" ]]; then
|
if [[ -n "$tag_prefix" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user