def __init__(self, directory): self._git_dir = directory self.refs = Refs(self) self._blobs = ObjectCache(lambda sha1: Blob(self, sha1)) self._trees = ObjectCache(lambda sha1: Tree(self, sha1)) self._commits = ObjectCache(lambda sha1: Commit(self, sha1)) self._default_index = None self._default_worktree = None self._default_iw = None self._catfile = CatFileProcess(self) self._difftree = DiffTreeProcesses(self)
def __init__(self, stack): self._stack = stack def create_patch(name): p = Patch(self._stack, name) p.commit # raise exception if the patch doesn't exist return p self._patches = ObjectCache(create_patch) # name -> Patch