Skip to content

Commit

Permalink
build-bottle-pr: fix --force option detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Jan 17, 2020
1 parent c07ced5 commit de55c2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/brew-build-bottle-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def build_bottle(formula)
return odie "#{formula}: PR already exists" if hub_pr_already_opened?(title)

unless Utils.popen_read("git", "branch", "--list", branch).empty?
return odie "#{formula}: Branch #{branch} already exists" unless ARGV.force?
return odie "#{formula}: Branch #{branch} already exists" unless ARGV.include? "--force"

ohai "#{formula}: Removing branch #{branch} in #{tap_dir}" if ARGV.verbose?
safe_system "git", "branch", "-D", branch
Expand All @@ -78,7 +78,7 @@ def build_bottle(formula)
if ARGV.value("dry_run").nil?
safe_system "git", "commit", formula_path, "-m", title
unless Utils.popen_read("git", "branch", "-r", "--list", "#{remote}/#{branch}").empty?
return odie "#{formula}: Remote branch #{remote}/#{branch} already exists" unless ARGV.force?
return odie "#{formula}: Remote branch #{remote}/#{branch} already exists" unless ARGV.include? "--force"

ohai "#{formula}: Removing branch #{branch} from #{remote}" if ARGV.verbose?
safe_system "git", "push", "--delete", remote, branch
Expand Down

0 comments on commit de55c2b

Please sign in to comment.