'Find the differences between the contents of this index and a tree.
:param object_store: Object store to use for retrieving tree contents
:param tree: SHA1 of the root tree
:param want_unchanged: Whether unchanged files should be reported
:return: Iterator over tuples with (oldpath, newpath), (oldmode,
newmode), (oldsha, newsha)'

def changes_from_tree(self, object_store, tree, want_unchanged=False):

    def lookup_entry(path):
        entry = self[path]
        return (entry.sha, entry.mode)
    for (name, mode, sha) in changes_from_tree(self._byname.keys(), lookup_entry, object_store, tree, want_unchanged=want_unchanged):
        (yield (name, mode, sha))
