mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Revert "Use Homebrew's gitconfig for various commands"
This commit is contained in:
parent
253a41f523
commit
17f80a44e6
@ -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
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
end
|
||||
end
|
||||
|
||||
def clone_repo
|
||||
Utils.with_homebrew_gitconfig do
|
||||
safe_system "git", *clone_args
|
||||
end
|
||||
cached_location.cd do
|
||||
safe_system "git", "config", "homebrew.cacheversion", cache_version
|
||||
checkout
|
||||
@ -815,10 +811,8 @@ 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
|
||||
end
|
||||
|
||||
def reset_args
|
||||
ref = case @ref_type
|
||||
@ -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
|
||||
fix_absolute_submodule_gitdir_references!
|
||||
end
|
||||
|
||||
|
@ -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
|
@ -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!"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user