Skip to content

Commit

Permalink
Merge pull request #839 from Homebrew/install_tag
Browse files Browse the repository at this point in the history
install: use stable tag.
  • Loading branch information
MikeMcQuaid committed Mar 14, 2024
2 parents aceed88 + 7d8eb69 commit 8eb0339
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion install.sh
Expand Up @@ -929,8 +929,14 @@ ohai "Downloading and installing Homebrew..."

execute "${USABLE_GIT}" "fetch" "--force" "origin"
execute "${USABLE_GIT}" "fetch" "--force" "--tags" "origin"
execute "${USABLE_GIT}" "remote" "set-head" "origin" "--auto" >/dev/null

execute "${USABLE_GIT}" "reset" "--hard" "origin/master"
LATEST_GIT_TAG="$("${USABLE_GIT}" tag --list --sort="-version:refname" | head -n1)"
if [[ -z "${LATEST_GIT_TAG}" ]]
then
abort "Failed to query latest Homebrew/brew Git tag."
fi
execute "${USABLE_GIT}" "checkout" "--force" "-B" "stable" "${LATEST_GIT_TAG}"

if [[ "${HOMEBREW_REPOSITORY}" != "${HOMEBREW_PREFIX}" ]]
then
Expand Down

0 comments on commit 8eb0339

Please sign in to comment.