'Look up an object in a Git tree.
:param lookup_obj: Callback for retrieving object by SHA1
:param path: Path to lookup
:return: A tuple of (mode, SHA) of the resulting path.'

def lookup_path(self, lookup_obj, path):

    parts = path.split('/')
    sha = self.id
    mode = None
    for p in parts:
        if (not p):
            continue
        obj = lookup_obj(sha)
        if (not isinstance(obj, Tree)):
            raise NotTreeError(sha)
        (mode, sha) = obj[p]
    return (mode, sha)
