def _get_envs_from_ref_paths(self, refs):
        def _check_ref(env_set, base_ref, rname):
            '''
            Check the ref and resolve it as the base_ref if it matches. If the
            resulting env is exposed via whitelist/blacklist, add it to the
            env_set.
            '''
            if base_ref is not None and base_ref == rname:
                rname = 'base'
            if self.env_is_exposed(rname):
                env_set.add(rname)

        ret = set()
        base_ref = getattr(self, 'base', None)
        for ref in refs:
            ref = re.sub('^refs/', '', ref)
            rtype, rname = ref.split('/', 1)
            if rtype == 'remotes':
                parted = rname.partition('/')
                rname = parted[2] if parted[2] else parted[0]
                _check_ref(ret, base_ref, rname)
            elif rtype == 'tags':
                _check_ref(ret, base_ref, rname)
        return ret
Return the names of remote refs (stripped of the remote name) and tags
dataset/ETHPy150Open saltstack/salt/salt/utils/gitfs.py/GitProvider._get_envs_from_ref_paths