bump-formula-pr: fix forking error when formula is guessed from url

Regression introduced in f90612ccf0db03681dc6cbf6585cca5bc27b84b1 (#6718).

`tap_full_name` returned from `use_correct_linux_tap` has been
required (`GitHub.create_fork(tap_full_name)`), but it was never set when the
formula is guessed from args.url, resulting in an API request to
https://api.github.com/repos//forks which 404s (note the missing :owner/:repo),
and subsequently

    Error: Unable to fork: Not Found!
This commit is contained in:
Zhiming Wang 2020-05-23 14:15:29 +08:00
parent 9265ea0c50
commit 83fa24741e
No known key found for this signature in database
GPG Key ID: 5B58F95EC95965D8

View File

@ -118,12 +118,6 @@ module Homebrew
formula = args.formulae.first formula = args.formulae.first
if formula
tap_full_name, origin_branch, previous_branch = use_correct_linux_tap(formula)
check_for_duplicate_pull_requests(formula, tap_full_name)
checked_for_duplicates = true
end
new_url = args.url new_url = args.url
if new_url && !formula if new_url && !formula
# Split the new URL on / and find any formulae that have the same URL # Split the new URL on / and find any formulae that have the same URL
@ -152,7 +146,8 @@ module Homebrew
end end
raise FormulaUnspecifiedError unless formula raise FormulaUnspecifiedError unless formula
check_for_duplicate_pull_requests(formula, tap_full_name) unless checked_for_duplicates tap_full_name, origin_branch, previous_branch = use_correct_linux_tap(formula)
check_for_duplicate_pull_requests(formula, tap_full_name)
requested_spec, formula_spec = if args.devel? requested_spec, formula_spec = if args.devel?
devel_message = " (devel)" devel_message = " (devel)"