From 30d822a468dc909aac5c83d078a59bfc85fc27aa Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 22 Oct 2009 10:15:47 +0200 Subject: index writing now creates a sha on the content making it possible to write valid indices after manually removing or altering entriesgst --- test/git/test_index.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/git/test_index.py') diff --git a/test/git/test_index.py b/test/git/test_index.py index 6208a1d9..c8f6f4e3 100644 --- a/test/git/test_index.py +++ b/test/git/test_index.py @@ -96,7 +96,14 @@ class TestTree(TestCase): # pick the first blob at the first stage we find and use it as resolved version three_way_index.resolve_blobs( l[0][1] for l in unmerged_blob_map.itervalues() ) - three_way_index.write_tree() + tree = three_way_index.write_tree() + assert isinstance(tree, Tree) + num_blobs = 0 + for blob in tree.traverse(predicate=lambda item: item.type == "blob"): + assert (blob.path,0) in three_way_index.entries + num_blobs += 1 + # END for each blob + assert num_blobs == len(three_way_index.entries) def test_custom_commit(self): -- cgit v1.2.1