diff options
| author | Mike McQuaid | 2016-09-17 19:41:21 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-21 09:03:51 +0100 |
| commit | b2c7d6d83d0eecba7057873b7cb3511d09183825 (patch) | |
| tree | 70b46faa0072e196f0bd2150e6ecc75757c13a8f /Library/Homebrew/cmd | |
| parent | f6fef7cdce5302ae6f3fed357612d31d1d08cd5a (diff) | |
| download | brew-b2c7d6d83d0eecba7057873b7cb3511d09183825.tar.bz2 | |
update.sh: update to latest Homebrew/brew tag.
Rather than following every change on `master` let’s have non-developer
users (i.e. those who have never run a `dev-cmd` or set
`HOMEBREW_DEVELOPER`) update between tags.
This provides a fairly natural beta (the `master` branch`) and stable
(the tags) approach without restricting us to any particular way of
managing our tags.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index acf4520ba..570a4c36b 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -215,7 +215,18 @@ merge_or_rebase() { trap reset_on_interrupt SIGINT - REMOTE_REF="origin/$UPSTREAM_BRANCH" + if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] + then + UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)" + fi + + if [ -n "$UPSTREAM_TAG" ] + then + REMOTE_REF="refs/tags/$UPSTREAM_TAG" + UPSTREAM_BRANCH="v$UPSTREAM_TAG" + else + REMOTE_REF="origin/$UPSTREAM_BRANCH" + fi if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]] then |
