Determine remote_url using git config

This commit is contained in:
Christoph Blecker 2018-09-07 11:08:35 -07:00
parent cb2cf654a4
commit 5f18f0bb03
No known key found for this signature in database
GPG Key ID: B34A59A9D39F838B

View File

@ -325,7 +325,11 @@ module Homebrew
odie "Unable to fork: #{e.message}!"
end
remote_url = response.fetch("clone_url")
if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*")
remote_url = response.fetch("ssh_url")
else
remote_url = response.fetch("clone_url")
end
username = response.fetch("owner").fetch("login")
safe_system "git", "fetch", "--unshallow", "origin" if shallow