def METHOD_NAME(self, tags_only: bool, freeze: bool) -> RevInfo:
    with tempfile.TemporaryDirectory() as tmp:
        _git = ('git', *git.NO_FS_MONITOR, '-C', tmp)
        if tags_only:
            tag_opt = '--abbrev=0'
        else:
            tag_opt = '--exact'
        tag_cmd = (*_git, 'describe', 'FETCH_HEAD', '--tags', tag_opt)
        git.init_repo(tmp, self.repo)
        cmd_output_b(*_git, 'config', 'extensions.partialClone', 'true')
        cmd_output_b(
            *_git, 'fetch', 'origin', 'HEAD',
            '--quiet', '--filter=blob:none', '--tags',
        )
        try:
            rev = cmd_output(*tag_cmd)[1].strip()
        except CalledProcessError:
            rev = cmd_output(*_git, 'rev-parse', 'FETCH_HEAD')[1].strip()
        else:
            if tags_only:
                rev = git.get_best_candidate_tag(rev, tmp)
        frozen = None
        if freeze:
            exact = cmd_output(*_git, 'rev-parse', rev)[1].strip()
            if exact != rev:
                rev, frozen = exact, rev
        try:
            # workaround for windows -- see #2865
            cmd_output_b(*_git, 'show', f'{rev}:{C.MANIFEST_FILE}')
            cmd_output(*_git, 'checkout', rev, '--', C.MANIFEST_FILE)
        except CalledProcessError:
            pass  # this will be caught by manifest validating code
        try:
            manifest = load_manifest(os.path.join(tmp, C.MANIFEST_FILE))
        except InvalidManifestError as e:
            raise RepositoryCannotBeUpdatedError(f'[{self.repo}] {e}')
        else:
            hook_ids = frozenset(hook['id'] for hook in manifest)
    return self._replace(rev=rev, frozen=frozen, hook_ids=hook_ids)