Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def apply_redirected_remote!(redirected_remote, quiet: false)
def git_command!(args, chdir: nil)
require "system_command"

SystemCommand.run!("git", args:, chdir:, print_stderr: true)
SystemCommand.run!("git", args:, chdir:, env: { "GIT_TERMINAL_PROMPT" => "0" }, print_stderr: true)
end
private :git_command!

Expand Down
9 changes: 9 additions & 0 deletions Library/Homebrew/test/tap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,15 @@ def setup_completion(link:)
end

describe "#install" do
it "disables terminal prompts for git commands" do
require "system_command"

expect(SystemCommand).to receive(:run!)
.with("git", args: %w[fetch], chdir: path, env: { "GIT_TERMINAL_PROMPT" => "0" }, print_stderr: true)

homebrew_foo_tap.send(:git_command!, %w[fetch], chdir: path)
end

it "raises an error when the Tap is already tapped" do
setup_git_repo
already_tapped_tap = described_class.fetch("Homebrew", "foo")
Expand Down