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