From 3dcfc7e26e663f8378d48aa6a6d48541aea31d9d Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 12 Oct 2021 20:21:58 +0800 Subject: [PATCH] tap: apply suggestions from code review Co-authored-by: Mike McQuaid --- Library/Homebrew/tap.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index a190778508..d9a626ad29 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -366,7 +366,7 @@ class Tap end def fix_remote_configuration(requested_remote: nil, quiet: false) - unless requested_remote.nil? + if requested_remote.present? path.cd do safe_system "git", "remote", "set-url", "origin", requested_remote safe_system "git", "config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*" @@ -375,10 +375,10 @@ class Tap end current_upstream_head = path.git_origin_branch - return if requested_remote.nil? && path.git_origin_has_branch?(current_upstream_head) + return if requested_remote.blank? && path.git_origin_has_branch?(current_upstream_head) args = %w[fetch] - args << "-q" if quiet + args << "--quiet" if quiet args << "origin" safe_system "git", "-C", path, *args path.git_origin_set_head_auto