From a29939e8ed36e6a8ac41c20bce3efa07afaf80d4 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 2 Mar 2023 14:04:31 +0800 Subject: [PATCH] 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. --- Library/Homebrew/cmd/update.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index cdfbd08ae3..cf096c46f8 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -575,8 +575,11 @@ EOS [[ -d "${DIR}/.git" ]] || continue cd "${DIR}" || continue - # Git's fsmonitor prevents the release of our locks - git config --bool core.fsmonitor false + if [[ "${DIR}" = "${HOMEBREW_REPOSITORY}" && "${HOMEBREW_REPOSITORY}" = "${HOMEBREW_PREFIX}" ]] + 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 then