Revert "Use Homebrew's gitconfig for various commands"

This commit is contained in:
ilovezfs 2018-01-15 07:30:56 +00:00 committed by GitHub
parent 253a41f523
commit 17f80a44e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 45 deletions

View File

@ -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

View File

@ -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

View File

@ -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() {

View File

@ -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

View File

@ -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

View File

@ -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!"

View File

@ -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