tg.sh: minor branch_needs_update efficiency