Merge pull request #5656 from MikeMcQuaid/update-reset-hang

update-reset: avoid hanging on shallow-since.
This commit is contained in:
Mike McQuaid 2019-02-02 19:00:39 +01:00 committed by GitHub
commit cbf049cc96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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..."