cmd/update.sh: limit setting core.fsmonitor to false

We set `core.fsmonitor` to `false` in #13586 because Git's fsmonitor
daemon prevented the release of our locks, resulting in errors for some
users reported in #13521.

However, the fix from #13586 set `core.fsmonitor` to `false` too often.
This is not needed for taps, or when `HOMEBREW_REPOSITORY` is different
from `HOMEBREW_PREFIX`. The issue in #13521 stems from the fsmonitor
daemon preventing the release of our locks, so there is no need to
prevent the daemon from monitoring repositories that don't contain our
lock files.
This commit is contained in:
Carlo Cabrera 2023-03-02 14:04:31 +08:00
parent 10dd6a30ca
commit a29939e8ed
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -575,8 +575,11 @@ EOS
[[ -d "${DIR}/.git" ]] || continue [[ -d "${DIR}/.git" ]] || continue
cd "${DIR}" || continue cd "${DIR}" || continue
# Git's fsmonitor prevents the release of our locks if [[ "${DIR}" = "${HOMEBREW_REPOSITORY}" && "${HOMEBREW_REPOSITORY}" = "${HOMEBREW_PREFIX}" ]]
git config --bool core.fsmonitor false then
# Git's fsmonitor prevents the release of our locks
git config --bool core.fsmonitor false
fi
if ! git config --local --get remote.origin.url &>/dev/null if ! git config --local --get remote.origin.url &>/dev/null
then then