tg.sh: avoid using stale information for non-read-only operations