From 56901775bf0b451b3f3f17443103a5220e7c775a Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Wed, 9 Sep 2020 12:22:45 -0500 Subject: [PATCH] brew.sh: use HOMEBREW_GIT instead of git --- Library/Homebrew/brew.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 6ef9369f3e..407c7f2b98 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -106,14 +106,6 @@ numeric() { printf "%01d%02d%02d%03d" ${1//[.rc]/ } 2>/dev/null } -HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbrev=7 2>/dev/null)" -HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION" -if [[ -z "$HOMEBREW_VERSION" ]] -then - HOMEBREW_VERSION=">=2.2.0 (shallow or no git repository)" - HOMEBREW_USER_AGENT_VERSION="2.X.Y" -fi - if [[ "$HOMEBREW_PREFIX" = "/" || "$HOMEBREW_PREFIX" = "/usr" ]] then # it may work, but I only see pain this route and don't want to support it @@ -144,6 +136,14 @@ else HOMEBREW_GIT="git" fi +HOMEBREW_VERSION="$("$HOMEBREW_GIT" -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbrev=7 2>/dev/null)" +HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION" +if [[ -z "$HOMEBREW_VERSION" ]] +then + HOMEBREW_VERSION=">=2.2.0 (shallow or no git repository)" + HOMEBREW_USER_AGENT_VERSION="2.X.Y" +fi + if [[ -n "$HOMEBREW_MACOS" ]] then HOMEBREW_PRODUCT="Homebrew"