Checkout the ext_pillar sources and compile the resulting pillar SLS

def ext_pillar(minion_id, pillar, *repos):  # pylint: disable=unused-argument
    '''
    Checkout the ext_pillar sources and compile the resulting pillar SLS
    '''
    opts = copy.deepcopy(__opts__)
    opts['pillar_roots'] = {}
    opts['__git_pillar'] = True
    git_pillar = salt.utils.gitfs.GitPillar(
        opts,
        repos,
        per_remote_overrides=PER_REMOTE_OVERRIDES,
        per_remote_only=PER_REMOTE_ONLY,
        global_only=GLOBAL_ONLY)
    if __opts__.get('__role') == 'minion':
        # If masterless, fetch the remotes. We'll need to remove this once
        # we make the minion daemon able to run standalone.
        git_pillar.fetch_remotes()
    git_pillar.checkout()
    ret = {}
    merge_strategy = __opts__.get(
        'pillar_source_merging_strategy',
        'smart'
    )
    merge_lists = __opts__.get(
        'pillar_merge_lists',
        False
    )
    for pillar_dir, env in six.iteritems(git_pillar.pillar_dirs):
        # Map env if env == '__env__' before checking the env value
        if env == '__env__':
            env = opts.get('pillarenv') \
                or opts.get('saltenv') \
                or opts.get('git_pillar_base')
            log.debug('__env__ maps to %s', env)

        # If pillarenv is set, only grab pillars with that match pillarenv
        if opts['pillarenv'] and env != opts['pillarenv']:
            log.debug(
                'env \'%s\' for pillar dir \'%s\' does not match '
                'pillarenv \'%s\', skipping',
                env, pillar_dir, opts['pillarenv']
            )
            continue
        if pillar_dir in git_pillar.pillar_linked_dirs:
            log.debug(
                'git_pillar is skipping processing on %s as it is a '
                'mounted repo', pillar_dir
            )
            continue
        else:
            log.debug(
                'git_pillar is processing pillar SLS from %s for pillar '
                'env \'%s\'', pillar_dir, env
            )

        pillar_roots = [pillar_dir]

        if __opts__['git_pillar_includes']:
            # Add the rest of the pillar_dirs in this environment to the
            # list, excluding the current pillar_dir being processed. This
            # is because it was already specified above as the first in the
            # list, so that its top file is sourced from the correct
            # location and not from another git_pillar remote.
            pillar_roots.extend(
                [d for (d, e) in six.iteritems(git_pillar.pillar_dirs)
                 if env == e and d != pillar_dir]
            )

        opts['pillar_roots'] = {env: pillar_roots}

        local_pillar = Pillar(opts, __grains__, minion_id, env)
        ret = salt.utils.dictupdate.merge(
            ret,
            local_pillar.compile_pillar(ext=False),
            strategy=merge_strategy,
            merge_lists=merge_lists
        )
    return ret