From 87cf4f7f7a5e69d9e0ba2271f7bde2b8bf7e5c1e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 24 Sep 2016 20:42:55 +0100 Subject: update.sh: use GitHub tags API. Otherwise if we've committed to `master` and someone `brew update`s before we cut the tag then they won't be updated to the latest version. --- Library/Homebrew/cmd/update.sh | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 579890820..4d72c6611 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -217,7 +217,8 @@ merge_or_rebase() { if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] then - UPSTREAM_TAG="$(git tag --list --sort=-version:refname | grep '^[0-9]*\.[0-9]*\.[0-9]*$' | head -n1)" + UPSTREAM_TAG="$(git tag --list --sort=-version:refname | + grep --max-count=1 '^[0-9]*\.[0-9]*\.[0-9]*$')" else UPSTREAM_TAG="" fi @@ -244,7 +245,7 @@ merge_or_rebase() { stash save --include-untracked "${QUIET_ARGS[@]}" then odie <