update.sh: only update to semver tags.

Otherwise random e.g. `pr-123` tags may cause `brew update` to update
to the wrong version.
This commit is contained in:
Mike McQuaid 2016-09-23 11:26:24 +01:00
parent bc52932e5a
commit b0dfd2d435

View File

@ -217,7 +217,7 @@ merge_or_rebase() {
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]]
then
UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)"
UPSTREAM_TAG="$(git tag --list --sort=-version:refname | grep '^[0-9]*\.[0-9]*\.[0-9]*$' | head -n1)"
else
UPSTREAM_TAG=""
fi