def commit(self, rev=None): """The Commit object for the specified revision :param rev: revision specifier, see git-rev-parse for viable options. :return: ``git.Commit``""" if rev is None: return self.head.commit return self.rev_parse(text_type(rev) + "^0")
def commit(self, rev=None): """The Commit object for the specified revision :param rev: revision specifier, see git-rev-parse for viable options. :return: ``git.Commit``""" if rev is None: return self.head.commit else: return self.rev_parse(text_type(rev) + "^0")
def tree(self, rev=None): """The Tree object for the given treeish revision Examples:: repo.tree(repo.heads[0]) :param rev: is a revision pointing to a Treeish ( being a commit or tree ) :return: ``git.Tree`` :note: If you need a non-root level tree, find it by iterating the root tree. Otherwise it cannot know about its path relative to the repository root and subsequent operations might have unexpected results.""" if rev is None: return self.head.commit.tree return self.rev_parse(text_type(rev) + "^{tree}")
def tree(self, rev=None): """The Tree object for the given treeish revision Examples:: repo.tree(repo.heads[0]) :param rev: is a revision pointing to a Treeish ( being a commit or tree ) :return: ``git.Tree`` :note: If you need a non-root level tree, find it by iterating the root tree. Otherwise it cannot know about its path relative to the repository root and subsequent operations might have unexpected results.""" if rev is None: return self.head.commit.tree else: return self.rev_parse(text_type(rev) + "^{tree}")