Skip to content
Snippets Groups Projects
Unverified Commit 9c7f73a4 authored by Jonathan Chang's avatar Jonathan Chang Committed by GitHub
Browse files

Merge pull request #8011 from SeekingMeaning/bump-duplicate

bump-formula-pr: restore formula if duplicate PR exists
parents 958f9151 79d4b27c
No related branches found
No related tags found
No related merge requests found
......@@ -307,7 +307,7 @@ module Homebrew
new_formula_version = formula_version(formula, requested_spec, new_contents)
check_for_duplicate_pull_requests(formula, tap_full_name, new_formula_version.to_s)
check_for_duplicate_pull_requests(formula, backup_file, tap_full_name, new_formula_version.to_s)
if !new_mirrors && !formula_spec.mirrors.empty?
if args.force?
......@@ -506,7 +506,7 @@ module Homebrew
[]
end
def check_for_duplicate_pull_requests(formula, tap_full_name, version)
def check_for_duplicate_pull_requests(formula, backup_file, tap_full_name, version)
# check for open requests
pull_requests = fetch_pull_requests(formula.name, tap_full_name, state: "open")
......@@ -522,8 +522,10 @@ module Homebrew
if args.force? && !args.quiet?
opoo duplicates_message
elsif !args.force? && args.quiet?
formula.path.atomic_write(backup_file) unless args.dry_run?
odie error_message
elsif !args.force?
formula.path.atomic_write(backup_file) unless args.dry_run?
odie <<~EOS
#{duplicates_message.chomp}
#{error_message}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment