diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 64e8a2e646..898e921ba7 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -39,6 +39,6 @@ module Homebrew end args = ARGV.options_only args += ["--follow", "--", path] unless path.nil? - Utils.with_homebrew_gitconfig { exec "git", "log", *args } + exec "git", "log", *args end end diff --git a/Library/Homebrew/cmd/update-reset.sh b/Library/Homebrew/cmd/update-reset.sh index 3b166b8ed6..5ba8ec9d82 100644 --- a/Library/Homebrew/cmd/update-reset.sh +++ b/Library/Homebrew/cmd/update-reset.sh @@ -28,8 +28,6 @@ EOS set -x fi - export HOME="$HOMEBREW_LIBRARY/Homebrew/gitconfig" - for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/* do [[ -d "$DIR/.git" ]] || continue diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index c28a79d024..7477845274 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -19,11 +19,7 @@ git() { then GIT_EXECUTABLE="$("$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" --homebrew=print-path)" fi - OLDHOME="$HOME" - export HOME="$HOMEBREW_LIBRARY/Homebrew/gitconfig" "$GIT_EXECUTABLE" "$@" - export HOME="$OLDHOME" - unset OLDHOME } git_init_if_necessary() { diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 4df9596a6e..feb518057f 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -793,19 +793,15 @@ class GitDownloadStrategy < VCSDownloadStrategy def update_repo return unless @ref_type == :branch || !ref? - Utils.with_homebrew_gitconfig do - if !shallow_clone? && shallow_dir? - quiet_safe_system "git", "fetch", "origin", "--unshallow" - else - quiet_safe_system "git", "fetch", "origin" - end + if !shallow_clone? && shallow_dir? + quiet_safe_system "git", "fetch", "origin", "--unshallow" + else + quiet_safe_system "git", "fetch", "origin" end end def clone_repo - Utils.with_homebrew_gitconfig do - safe_system "git", *clone_args - end + safe_system "git", *clone_args cached_location.cd do safe_system "git", "config", "homebrew.cacheversion", cache_version checkout @@ -815,9 +811,7 @@ class GitDownloadStrategy < VCSDownloadStrategy def checkout ohai "Checking out #{@ref_type} #{@ref}" if @ref_type && @ref - Utils.with_homebrew_gitconfig do - quiet_safe_system "git", "checkout", "-f", @ref, "--" - end + quiet_safe_system "git", "checkout", "-f", @ref, "--" end def reset_args @@ -836,10 +830,8 @@ class GitDownloadStrategy < VCSDownloadStrategy end def update_submodules - Utils.with_homebrew_gitconfig do - quiet_safe_system "git", "submodule", "foreach", "--recursive", "git submodule sync" - quiet_safe_system "git", "submodule", "update", "--init", "--recursive" - end + quiet_safe_system "git", "submodule", "foreach", "--recursive", "git submodule sync" + quiet_safe_system "git", "submodule", "update", "--init", "--recursive" fix_absolute_submodule_gitdir_references! end diff --git a/Library/Homebrew/gitconfig/.gitconfig b/Library/Homebrew/gitconfig/.gitconfig deleted file mode 100644 index 2f68bde0da..0000000000 --- a/Library/Homebrew/gitconfig/.gitconfig +++ /dev/null @@ -1,14 +0,0 @@ -[user] - # Name used in commit messages. - name = Homebrew - # Email used in commit messages. - email = git@brew.sh -[fetch] - # Always prune when fetching (and pulling). - prune = 1 -[core] - # Don't prompt for commit messages for merge commits. - mergeoptions = --no-edit -[credential] - # Use macOS Keychain to store HTTP passwords. - helper = osxkeychain diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 291bbe0770..ed93e12663 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -230,7 +230,7 @@ class Tap ohai "Unshallowing #{name}" unless quiet args = %w[fetch --unshallow] args << "-q" if quiet - Utils.with_homebrew_gitconfig { path.cd { safe_system "git", *args } } + path.cd { safe_system "git", *args } return end @@ -242,7 +242,7 @@ class Tap args << "-q" if quiet begin - Utils.with_homebrew_gitconfig { safe_system "git", *args } + safe_system "git", *args unless Readall.valid_tap?(self, aliases: true) unless ARGV.homebrew_developer? raise "Cannot tap #{name}: invalid syntax in tap!" diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb index c50979b1e6..f1113af661 100644 --- a/Library/Homebrew/utils/git.rb +++ b/Library/Homebrew/utils/git.rb @@ -60,12 +60,6 @@ module Utils raise "Git is unavailable" unless git_available? end - def self.with_homebrew_gitconfig - with_env(HOME: HOMEBREW_LIBRARY/"Homebrew/gitconfig") do - yield if block_given? - end - end - def self.clear_git_available_cache @git = nil @git_path = nil