'Return map of named refs (branches or tags) to commit hashes.'

def get_short_refs(self, location):

    rv = {}
    for (commit, ref) in self.get_full_refs(location):
        ref_name = None
        if self.is_ref_remote(ref):
            ref_name = ref[len('refs/remotes/'):]
        elif self.is_ref_branch(ref):
            ref_name = ref[len('refs/heads/'):]
        elif self.is_ref_tag(ref):
            ref_name = ref[len('refs/tags/'):]
        if (ref_name is not None):
            rv[ref_name] = commit
    return rv
