update.sh: use sort instead of git tag --sort.

Older versions of Git don't have this flag and we don't want to block
updates for them when there's a (relatively) simple workaround.
This commit is contained in:
Mike McQuaid 2016-09-29 09:16:15 +01:00
parent ff4636bd85
commit d4311fd49f

View File

@ -217,7 +217,8 @@ merge_or_rebase() {
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -n "$HOMEBREW_UPDATE_TO_TAG" ]]
then
UPSTREAM_TAG="$(git tag --list --sort=-version:refname |
UPSTREAM_TAG="$(git tag --list |
sort --field-separator=. --key=1,1nr -k 2,2nr -k 3,3nr |
grep --max-count=1 '^[0-9]*\.[0-9]*\.[0-9]*$')"
else
UPSTREAM_TAG=""