def resolve_tag_repo_ref!(tag)
      return unless tag.has_repo?
      repo = core.repo_manager.find_repository(tag.repo)
      # set latest version
      if tag.has_ref? === false
        if repo.has_package_versions?
          tag.set_ref repo.latest_package_version
        else
          tag.set_ref repo.current_ref
        end
      else
        unless repo.has_ref?(tag.ref)
          new_ref = repo.latest_version(tag.ref)
          raise "error" if new_ref.nil?
          tag.set_ref new_ref
        end
      end
    end
def resolve_tag_repo_ref!(tag)
      return unless tag.has_repo?
      repo = core.repo_manager.find_repository(tag.repo)
      # set latest version
      if tag.has_ref? === false
        if repo.has_package_versions?
          tag.set_ref repo.latest_package_version
        else
          tag.set_ref repo.current_ref
        end
      else
        unless repo.has_ref?(tag.ref)
          new_ref = repo.latest_version(tag.ref)
          raise "error" if new_ref.nil?
          tag.set_ref new_ref
        end
      end
    end
Resolve tag's ref