'Get a dict of peeled values of tags to their original tag shas.
:param refs: dict of refname -> sha of possible tags; defaults to all
of the backend\'s refs.
:param repo: optional Repo instance for getting peeled refs; defaults
to the backend\'s repo, if available
:return: dict of peeled_sha -> tag_sha, where tag_sha is the sha of a
tag whose peeled value is peeled_sha.'

def get_tagged(self, refs=None, repo=None):

    if (not self.has_capability(CAPABILITY_INCLUDE_TAG)):
        return {}
    if (refs is None):
        refs = self.repo.get_refs()
    if (repo is None):
        repo = getattr(self.repo, 'repo', None)
        if (repo is None):
            return {}
    tagged = {}
    for (name, sha) in refs.items():
        peeled_sha = repo.get_peeled(name)
        if (peeled_sha != sha):
            tagged[peeled_sha] = sha
    return tagged
