Fix signature for forked_repo_info

This commit is contained in:
Maxim Belkin 2019-11-26 12:14:21 -06:00
parent 40b0b32a72
commit 5ba5a2795e
No known key found for this signature in database
GPG Key ID: AC71560D4C5F2338

View File

@ -341,7 +341,7 @@ module Homebrew
remote_url = Utils.popen_read("git remote get-url --push origin").chomp
username = formula.tap.user
else
remote_url, username = forked_repo_info(tap_full_name)
remote_url, username = forked_repo_info(formula, tap_full_name, backup_file)
end
safe_system "git", "fetch", "--unshallow", "origin" if shallow
@ -380,7 +380,7 @@ module Homebrew
end
end
def forked_repo_info(tap_full_name)
def forked_repo_info(formula, tap_full_name, backup_file)
response = GitHub.create_fork(tap_full_name)
rescue GitHub::AuthenticationFailedError, *GitHub.api_errors => e
formula.path.atomic_write(backup_file)
@ -388,7 +388,7 @@ module Homebrew
else
# GitHub API responds immediately but fork takes a few seconds to be ready.
sleep 1 until GitHub.check_fork_exists(tap_full_name)
remote_url = if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*")
remote_url = if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*")
response.fetch("ssh_url")
else
response.fetch("clone_url")