From b0dfd2d435fe6f5617bd699be90d86ad84bced02 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 23 Sep 2016 11:26:24 +0100 Subject: [PATCH] update.sh: only update to semver tags. Otherwise random e.g. `pr-123` tags may cause `brew update` to update to the wrong version. --- Library/Homebrew/cmd/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 5f082024d5..177958266c 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -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