aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.sh
diff options
context:
space:
mode:
authorMike McQuaid2016-09-23 11:26:24 +0100
committerMike McQuaid2016-09-23 11:26:24 +0100
commitb0dfd2d435fe6f5617bd699be90d86ad84bced02 (patch)
tree66cfde121c2f86ee2db12ede13792519ec456079 /Library/Homebrew/cmd/update.sh
parentbc52932e5ab83d253850cc622c7a0032e9d2de20 (diff)
downloadbrew-b0dfd2d435fe6f5617bd699be90d86ad84bced02.tar.bz2
update.sh: only update to semver tags.
Otherwise random e.g. `pr-123` tags may cause `brew update` to update to the wrong version.
Diffstat (limited to 'Library/Homebrew/cmd/update.sh')
-rw-r--r--Library/Homebrew/cmd/update.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 5f082024d..177958266 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