From 96b95a838a9a74f157f7aa99f5da8238e4b87928 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 12 May 2018 21:13:17 +0100 Subject: [PATCH] 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. --- Library/Homebrew/dev-cmd/pull.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 3947846963..00adee83a7 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -102,6 +102,18 @@ module Homebrew ENV["GIT_COMMITTER_EMAIL"] = ENV["HOMEBREW_GIT_EMAIL"] 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? # Formulae with affected bottles that were published