Merge pull request #4161 from alyssais/pull-gpg

Fix brew pull with git commit.gpgsign enabled
This commit is contained in:
Mike McQuaid 2018-05-23 14:21:40 +01:00 committed by GitHub
commit 63ffbd3298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,6 +102,20 @@ module Homebrew
ENV["GIT_COMMITTER_EMAIL"] = ENV["HOMEBREW_GIT_EMAIL"]
end
# Depending on user configuration, git may try to invoke gpg.
if Utils.popen_read("git config --get --bool commit.gpgsign").chomp == "true"
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
end
do_bump = @args.bump? && !@args.clean?
# Formulae with affected bottles that were published