diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 618ce68cca..b8c5f4bf6a 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -85,6 +85,8 @@ module Homebrew def edit args = edit_args.parse + ENV["COLORTERM"] = ENV.fetch("HOMEBREW_COLORTERM", nil) + unless (HOMEBREW_REPOSITORY/".git").directory? odie <<~EOS Changes will be lost! diff --git a/bin/brew b/bin/brew index f0231165d6..e842609c5d 100755 --- a/bin/brew +++ b/bin/brew @@ -152,6 +152,7 @@ done # We don't want to take the user's value for, e.g., `HOMEBREW_PATH` here! USED_BY_HOMEBREW_VARS=( CODESPACES + COLORTERM DBUS_SESSION_BUS_ADDRESS PATH SSH_TTY