Skip to content

Commit d5b6ecf

Browse files
authored
Merge pull request #998 from MikeMcQuaid/update-between-tags
update.sh: update to latest Homebrew/brew tag.
2 parents 066cd46 + e8ebcb8 commit d5b6ecf

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Library/Homebrew/brew.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
HOMEBREW_VERSION="0.9.9"
1+
HOMEBREW_VERSION="1.0.0"
22

33
onoe() {
44
if [[ -t 2 ]] # check whether stderr is a tty.

Library/Homebrew/cmd/update.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,18 @@ merge_or_rebase() {
215215

216216
trap reset_on_interrupt SIGINT
217217

218-
REMOTE_REF="origin/$UPSTREAM_BRANCH"
218+
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]]
219+
then
220+
UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)"
221+
fi
222+
223+
if [ -n "$UPSTREAM_TAG" ]
224+
then
225+
REMOTE_REF="refs/tags/$UPSTREAM_TAG"
226+
UPSTREAM_BRANCH="v$UPSTREAM_TAG"
227+
else
228+
REMOTE_REF="origin/$UPSTREAM_BRANCH"
229+
fi
219230

220231
if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]]
221232
then
@@ -337,7 +348,7 @@ EOS
337348
set -x
338349
fi
339350

340-
if [[ -z "$HOMEBREW_UPDATE_CLEANUP" ]]
351+
if [[ -z "$HOMEBREW_UPDATE_CLEANUP" && -z "$HOMEBREW_UPDATE_TO_TAG" ]]
341352
then
342353
if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]]
343354
then

0 commit comments

Comments
 (0)