Rename @branch_or_tag to ref and memoize on first use.