Skip to content

Commit

Permalink
update.sh: refuse to update shallow homebrew-core/cask clones.
Browse files Browse the repository at this point in the history
GitHub has requested this as these are extremely expensive operations.
  • Loading branch information
MikeMcQuaid committed Dec 3, 2020
1 parent 68889b9 commit 10e7316
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Library/Homebrew/cmd/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,26 @@ EOS
fi
fi

# Homebrew/homebrew-core is extremely expensive to perform shallow clones on
# so, on GitHub's request, don't allow it.
if [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/shallow" ]]
then
odie <<EOS
homebrew-core is a shallow clone. To \`brew update\` first run:
git -C "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" fetch --unshallow
EOS
fi

# Homebrew/homebrew-cask is also extremely expensive to perform shallow clones
# on so, on GitHub's request, don't allow it.
if [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask/.git/shallow" ]]
then
odie <<EOS
homebrew-cask is a shallow clone. To \`brew update\` first run:
git -C "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask" fetch --unshallow
EOS
fi

export GIT_TERMINAL_PROMPT="0"
export GIT_SSH_COMMAND="ssh -oBatchMode=yes"

Expand Down

0 comments on commit 10e7316

Please sign in to comment.