From e20ccfdb5309c11d0d395a075339911ffa72daf7 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Wed, 14 Nov 2018 13:32:41 -0500 Subject: [PATCH] update: change repo remotes to HTTPS if possible Older systems will install Homebrew via git://, but can switch to https:// if a newer curl is installed. --- Library/Homebrew/cmd/update.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 370197e702..fc5e50e868 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -428,6 +428,15 @@ EOS safe_cd "$HOMEBREW_REPOSITORY" + # if an older system had a newer curl installed, change each repo's remote URL from GIT to HTTPS + if [[ -n "$HOMEBREW_SYSTEM_CURL_TOO_OLD" && + -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" && + "$(git config remote.origin.url)" =~ ^git:// ]] + then + git config remote.origin.url "$BREW_OFFICIAL_REMOTE" + git config -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/config" remote.origin.url "$CORE_OFFICIAL_REMOTE" + fi + # kill all of subprocess on interrupt trap '{ /usr/bin/pkill -P $$; wait; exit 130; }' SIGINT