Skip to content
Snippets Groups Projects
Commit 2b8ea079 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

update: don't recheck taps checked in the last 1m.

This is less than ideal but it gets the time on my machine down from ~6s
to ~2s when checking no taps. It still shows that we're doing way more
in `update.sh` than we need to be doing but that's a future PR.
parent cc752e97
No related branches found
No related tags found
No related merge requests found
......@@ -386,6 +386,8 @@ EOS
(
if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]]
then
# Skip taps checked/fetched recently
[[ -n "$(find "$DIR/.git/FETCH_HEAD" -type f -mmin -1)" ]] && exit
# Skip taps without formulae.
FORMULAE="$(find "$DIR" -maxdepth 1 \( -name "*.rb" -or -name Formula -or -name HomebrewFormula \) -print -quit)"
[[ -z "$FORMULAE" ]] && exit
......@@ -405,6 +407,8 @@ EOS
--header "Accept: application/vnd.github.v3.sha" \
--header "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
"https://api.github.com/repos/$UPSTREAM_REPOSITORY/commits/$UPSTREAM_BRANCH")"
# Touch FETCH_HEAD to confirm we've checked for an update.
[[ -f "$DIR/.git/FETCH_HEAD" ]] && touch "$DIR/.git/FETCH_HEAD"
[[ "$UPSTREAM_SHA_HTTP_CODE" = "304" ]] && exit
elif [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]]
then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment