From f648b071adab14a57f68d27048974e223d036e0e Mon Sep 17 00:00:00 2001 From: Nanda H Krishna Date: Fri, 2 Apr 2021 14:58:31 +0530 Subject: [PATCH] dev-cmd/tap-new: use `Utils::Git.setup_gpg!` --- Library/Homebrew/dev-cmd/tap-new.rb | 3 +++ Library/Homebrew/test/dev-cmd/tap-new_spec.rb | 3 +++ .../support/helper/spec/shared_context/integration_test.rb | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index fee8572a36..b977cb0b22 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -149,6 +149,9 @@ module Homebrew unless args.no_git? cd tap.path do + Utils::Git.set_name_email! + Utils::Git.setup_gpg! + # Would be nice to use --initial-branch here but it's not available in # older versions of Git that we support. safe_system "git", "-c", "init.defaultBranch=#{branch}", "init" diff --git a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb index 4f3c229d28..a1a24af6ed 100644 --- a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb +++ b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb @@ -7,6 +7,9 @@ describe "brew tap-new" do it_behaves_like "parseable arguments" it "initializes a new tap with a README file and GitHub Actions CI", :integration_test do + # To ensure that Utils::Git.setup_gpg! doesn't raise an error + setup_test_formula "gnupg" + expect { brew "tap-new", "homebrew/foo", "--verbose" } .to be_a_success .and output(%r{homebrew/foo}).to_stdout diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb index 88ea92b7f3..e8e0a354e1 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -162,7 +162,7 @@ RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWordin # something here RUBY - when "foo", "patchelf" + when "foo", "gnupg", "patchelf" content = <<~RUBY url "https://brew.sh/#{name}-1.0" RUBY