aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorZhiming Wang2016-09-24 05:45:21 -0400
committerZhiming Wang2016-09-24 05:49:04 -0400
commit07866f0b54e0d8cd26f761922f242aa0ec73c40c (patch)
tree54e18db47961d5217fbc944a2e536b0311c6967a /Library/Homebrew/cmd
parent12aad5c65fee39c5f044e39ca1efcbed58aebd39 (diff)
downloadbrew-07866f0b54e0d8cd26f761922f242aa0ec73c40c.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/update.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 177958266..ba230bdec 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