fix latest_tag in homebrew/brew update

This commit is contained in:
shcai97 2020-09-08 10:41:45 +08:00
parent d0e1595fcf
commit 249e8e29f9

View File

@ -428,7 +428,7 @@ EOS
echo "HOMEBREW_BREW_GIT_REMOTE set: using $HOMEBREW_BREW_GIT_REMOTE for Homebrew/brew Git remote."
git remote set-url origin "$HOMEBREW_BREW_GIT_REMOTE"
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
latest_tag="$(git ls-remote --tags --refs -q origin | tail -n1 | cut -f2)"
latest_tag="$(git ls-remote --tags --refs --sort=v:refname -q origin | tail -n1 | cut -f2)"
git fetch --force origin --shallow-since="$latest_tag"
fi