update-reset: avoid hanging on shallow-since.

For some reason this seems to hang when there's been no commits since
the latest tag. Not a problem in `brew update`.
This commit is contained in:
Mike McQuaid 2019-02-02 18:34:44 +01:00
parent 1920eecb71
commit 4101bfda81
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -35,14 +35,7 @@ homebrew-update-reset() {
[[ -d "$DIR/.git" ]] || continue
cd "$DIR" || continue
echo "==> Fetching $DIR..."
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" ]]; then
latest_tag="$(git ls-remote --tags --refs -q origin | tail -n1 | cut -f2)"
git fetch --force origin --shallow-since="$latest_tag"
else
git fetch --force --tags origin
fi
git fetch --force --tags origin
echo
echo "==> Resetting $DIR..."