Ejemplo n.º 1
0
 def run(self, args):
     opts, args = getopt(args, "", ["message"])
     if args == []:
         print("usage: dulwich commit-tree tree")
         sys.exit(1)
     opts = dict(opts)
     porcelain.commit_tree(".", tree=args[0], message=opts["--message"])
Ejemplo n.º 2
0
 def test_simple(self):
     c1, c2, c3 = build_commit_graph(self.repo.object_store, [[1], [2, 1],
         [3, 1, 2]])
     b = Blob()
     b.data = b"foo the bar"
     t = Tree()
     t.add(b"somename", 0o100644, b.id)
     self.repo.object_store.add_object(t)
     self.repo.object_store.add_object(b)
     sha = porcelain.commit_tree(
         self.repo.path, t.id, message=b"Withcommit.",
         author=b"Joe <*****@*****.**>",
         committer=b"Jane <*****@*****.**>")
     self.assertTrue(isinstance(sha, bytes))
     self.assertEqual(len(sha), 40)