def file_list(self, tgt_env):
        '''
        Get file list for the target environment using dulwich
        '''
        def _traverse(tree, blobs, prefix):
            '''
            Traverse through a dulwich Tree object recursively, accumulating
            all the file paths and symlinks info in the "blobs" dict
            '''
            for item in six.iteritems(tree):
                try:
                    obj = self.repo.get_object(item.sha)
                except __HOLE__:
                    # Entry is a submodule, skip it
                    continue
                if isinstance(obj, dulwich.objects.Blob):
                    repo_path = os.path.join(prefix, item.path)
                    blobs.setdefault('files', []).append(repo_path)
                    mode, oid = tree[item.path]
                    if stat.S_ISLNK(mode):
                        link_tgt = self.repo.get_object(oid).as_raw_string()
                        blobs.setdefault('symlinks', {})[repo_path] = link_tgt
                elif isinstance(obj, dulwich.objects.Tree):
                    _traverse(obj, blobs, os.path.join(prefix, item.path))

        files = set()
        symlinks = {}
        tree = self.get_tree(tgt_env)
        tree = self.walk_tree(tree, self.root)
        if not isinstance(tree, dulwich.objects.Tree):
            return files, symlinks
        blobs = {}
        if len(tree):
            _traverse(tree, blobs, self.root)
        if self.root:
            relpath = lambda path: os.path.relpath(path, self.root)
        else:
            relpath = lambda path: path
        add_mountpoint = lambda path: os.path.join(self.mountpoint, path)
        for repo_path in blobs.get('files', []):
            files.add(add_mountpoint(relpath(repo_path)))
        for repo_path, link_tgt in six.iteritems(blobs.get('symlinks', {})):
            symlinks[add_mountpoint(relpath(repo_path))] = link_tgt
        return files, symlinks
dataset/ETHPy150Open saltstack/salt/salt/utils/gitfs.py/Dulwich.file_list