Skip to content
Snippets Groups Projects
Unverified Commit 1789c27b authored by shcai97's avatar shcai97 Committed by GitHub
Browse files

use --key and --numeric-sort

parent 77f2a24a
No related branches found
No related tags found
No related merge requests found
......@@ -430,8 +430,8 @@ EOS
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
latest_tag="$(git ls-remote --tags --refs -q origin |
cut -d/ -f3 |
sort --field-separator=. --key=1,1nr -k 2,2nr -k 3,3nr|
head -n1)"
sort --numeric-sort --field-separator=. --key=1,1 --key=2,2 --key=3,3 |
tail -n1)"
latest_ref="refs/tags/$latest_tag"
git fetch --force origin --shallow-since="$latest_ref"
fi
......
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