Fix brew pull with git commit.gpgsign enabled

Because of environment filtering, git tries to sign the commit but
can't find gpg, which means that the patch won't be applied.
This commit is contained in:
Alyssa Ross 2018-05-12 21:13:17 +01:00
parent a3d639dc49
commit 96b95a838a
No known key found for this signature in database
GPG Key ID: 6CF064D149E3ABDB

View File

@ -102,6 +102,18 @@ module Homebrew
ENV["GIT_COMMITTER_EMAIL"] = ENV["HOMEBREW_GIT_EMAIL"] ENV["GIT_COMMITTER_EMAIL"] = ENV["HOMEBREW_GIT_EMAIL"]
end end
# Depending on user configuration, git may try to invoke gpg.
begin
gnupg = Formula["gnupg"]
rescue FormulaUnavailableError # rubocop:disable Lint/HandleExceptions
else
if gnupg.installed?
path = PATH.new(ENV.fetch("PATH"))
path.prepend(gnupg.installed_prefix/"bin")
ENV["PATH"] = path
end
end
do_bump = @args.bump? && !@args.clean? do_bump = @args.bump? && !@args.clean?
# Formulae with affected bottles that were published # Formulae with affected bottles that were published