Browse Source

Add a test.

Jelmer Vernooij 3 năm trước cách đây
mục cha
commit
189172bff8
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      dulwich/tests/test_objectspec.py

+ 6 - 0
dulwich/tests/test_objectspec.py

@@ -258,3 +258,9 @@ class ParseTreeTests(TestCase):
         c1, c2, c3 = build_commit_graph(r.object_store, [[1], [2, 1], [3, 1, 2]])
         self.assertEqual(r[c1.tree], parse_tree(r, c1.id))
         self.assertEqual(r[c1.tree], parse_tree(r, c1.tree))
+
+    def test_from_ref(self):
+        r = MemoryRepo()
+        c1, c2, c3 = build_commit_graph(r.object_store, [[1], [2, 1], [3, 1, 2]])
+        r.refs[b'refs/heads/foo'] = c1.id
+        self.assertEqual(r[c1.tree], parse_tree(r, b'foo'))