mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 05:59:17 +03:00
unstableGitUpdater: Try full history if failed to find any tags in shallow clone
This commit is contained in:
parent
460374eb04
commit
3cd4a35e71
1 changed files with 9 additions and 8 deletions
|
@ -90,19 +90,20 @@ let
|
||||||
${git}/bin/git fetch --depth="$depth" --tags
|
${git}/bin/git fetch --depth="$depth" --tags
|
||||||
depth=$(( $depth * 2 ))
|
depth=$(( $depth * 2 ))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ -z "$last_tag" ]]; then
|
||||||
|
# To be extra sure, check if full history helps with finding a tag
|
||||||
|
git fetch --tags
|
||||||
|
last_tag="$(${git}/bin/git describe --tags --abbrev=0 2> /dev/null || true)"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
last_tag="$(${git}/bin/git describe --tags --abbrev=0 2> /dev/null || true)"
|
last_tag="$(${git}/bin/git describe --tags --abbrev=0 2> /dev/null || true)"
|
||||||
fi
|
fi
|
||||||
if [[ -z "$last_tag" ]]; then
|
if [[ -z "$last_tag" ]]; then
|
||||||
if [[ "$shallow_clone" == "1" ]]; then
|
last_tag="0"
|
||||||
echo "Cound not find a tag within last 10000 commits" > /dev/stderr
|
|
||||||
else
|
|
||||||
echo "Cound not find a tag" > /dev/stderr
|
|
||||||
fi
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
if [[ -n "$tag_prefix" ]]; then
|
if [[ -n "$tag_prefix" ]]; then
|
||||||
last_tag="''${last_tag#$tag_prefix}"
|
last_tag="''${last_tag#$tag_prefix}"
|
||||||
fi
|
fi
|
||||||
if [[ ! "$last_tag" =~ ^[[:digit:]] ]]; then
|
if [[ ! "$last_tag" =~ ^[[:digit:]] ]]; then
|
||||||
echo "Last tag '$last_tag' (after removing prefix '$tag_prefix') does not start with a digit" > /dev/stderr
|
echo "Last tag '$last_tag' (after removing prefix '$tag_prefix') does not start with a digit" > /dev/stderr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue