diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index b3806891df..4a6ad15dfd 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -266,7 +266,8 @@ EOS then git checkout --force "${UPSTREAM_BRANCH}" "${QUIET_ARGS[@]}" else - if [[ -n "${UPSTREAM_TAG}" && "${UPSTREAM_BRANCH}" != "master" ]] + if [[ -n "${UPSTREAM_TAG}" && "${UPSTREAM_BRANCH}" != "master" ]] && + [[ "${INITIAL_BRANCH}" != "master" ]] then git branch --force "master" "origin/master" "${QUIET_ARGS[@]}" fi