From 83fa24741e943e74c68c0eb33531f505a17743be Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Sat, 23 May 2020 14:15:29 +0800 Subject: [PATCH] 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! --- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index c08997c8aa..77b64f8832 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -118,12 +118,6 @@ module Homebrew 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 if new_url && !formula # Split the new URL on / and find any formulae that have the same URL @@ -152,7 +146,8 @@ module Homebrew end 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? devel_message = " (devel)"