From 70e0b500e90ab9bf0a4d863da9ab65fcef3b57c8 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 9 Jan 2020 14:14:44 +0000 Subject: [PATCH] diagnostic: fix suggested origin URL. Fixes #6909. --- Library/Homebrew/diagnostic.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 27b4922dca..7931a86d9e 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -120,7 +120,7 @@ module Homebrew Without a correctly configured origin, Homebrew won't update properly. You can solve this by adding the remote: - git -C "#{repository_path}" remote add origin #{Formatter.url("https://github.com/#{desired_origin}.git")} + git -C "#{repository_path}" remote add origin #{Formatter.url(desired_origin)} EOS elsif !current_origin.match?(%r{#{desired_origin}(\.git|/)?$}i) <<~EOS @@ -130,7 +130,7 @@ module Homebrew With a non-standard origin, Homebrew won't update properly. You can solve this by setting the origin remote: - git -C "#{repository_path}" remote set-url origin #{Formatter.url("https://github.com/#{desired_origin}")} + git -C "#{repository_path}" remote set-url origin #{Formatter.url(desired_origin)} EOS end end @@ -568,8 +568,10 @@ module Homebrew end def check_casktap_git_origin - cask = Tap.default_cask_tap - examine_git_origin(cask.path, cask.full_name) if cask.installed? + cask_tap = Tap.default_cask_tap + return unless cask_tap.installed? + + examine_git_origin(cask_tap.path, cask_tap.remote) end def check_coretap_git_branch