Merge pull request #12186 from Bo98/update-reset-fix

cmd/update-reset: fix errors when the git shim changes in a brew update
This commit is contained in:
Carlo Cabrera 2021-10-05 11:14:01 +08:00 committed by GitHub
commit b980fa1c91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,18 @@
#:
#: *Note:* this will destroy all your uncommitted or committed changes.
# Replaces the function in Library/Homebrew/brew.sh to cache the Git executable to provide
# speedup when using Git repeatedly and prevent errors if the shim changes mid-update.
git() {
if [[ -z "${GIT_EXECUTABLE}" ]]
then
# HOMEBREW_LIBRARY is set by bin/brew
# shellcheck disable=SC2154
GIT_EXECUTABLE="$("${HOMEBREW_LIBRARY}/Homebrew/shims/shared/git" --homebrew=print-path)"
fi
"${GIT_EXECUTABLE}" "$@"
}
homebrew-update-reset() {
local DIR
local -a REPOS=()

1
Library/Homebrew/shims/scm Symbolic link
View File

@ -0,0 +1 @@
shared