def walk_tree(self, tree, path):
        '''
        Dulwich does not provide a means of directly accessing subdirectories.
        This function will walk down to the directory specified by 'path', and
        return a Tree object at that path. If path is an empty string, the
        original tree will be returned, and if there are any issues encountered
        walking the tree, None will be returned.
        '''
        if not path:
            return tree
        # Walk down the tree to get to the file
        for parent in path.split(os.path.sep):
            try:
                tree = self.repo.get_object(tree[parent][1])
            except (KeyError, __HOLE__):
                # Directory not found, or tree passed into function is not a Tree
                # object. Either way, desired path does not exist.
                return None
        return tree
dataset/ETHPy150Open saltstack/salt/salt/utils/gitfs.py/Dulwich.walk_tree