From 07866f0b54e0d8cd26f761922f242aa0ec73c40c Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Sat, 24 Sep 2016 05:45:21 -0400 Subject: [PATCH] update.sh: do not restore stable (tag) branch Restoring stable branch post-update could lead to unsuspecting users with homebrew.devcmdrun being stuck forever on an old tag. Fixes #1111. --- Library/Homebrew/cmd/update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 177958266c..ba230bdec2 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -297,7 +297,8 @@ EOS if [[ -n "$HOMEBREW_NO_UPDATE_CLEANUP" ]] then - if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] + if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" && + ! "$INITIAL_BRANCH" =~ ^v[0-9]+\.[0-9]+\.[0-9]$ ]] then git checkout "$INITIAL_BRANCH" "${QUIET_ARGS[@]}" fi