update.sh: correct .refs-before and .refs-after sort order