@Test public void testMetadataIdChangeOnly() { leftTree = createHeadTree(// repoTree("buildings", EMPTY_ID, null, 0), // repoTree("buildings/stores", "a5", "d3", 5)// old md id is d3 ); rightTree = createStageHeadTree(// indexTree("buildings", EMPTY_ID, null, 0), // indexTree("buildings/stores", "a5", "d31", 5)// new md id is d31 ); ObjectId newRepoRoot = command.call(); assertNotNull(newRepoRoot); // check all blobs have been moved from the index to the object database verifyRepositoryTree(NodeRef.ROOT, newRepoRoot); ImmutableMap<String, NodeRef> refsByPath = getTreeRefsByPath(newRepoRoot); assertEquals(set("buildings", "buildings/stores"), refsByPath.keySet()); assertEquals(id("d31"), refsByPath.get("buildings/stores").getMetadataId()); }
@Test public void testMetadataIdChangeOnly() { leftTree = createHeadTree(// repoTree("buildings", EMPTY_ID, null, 0), // repoTree("buildings/stores", "a5", "d3", 5)// old md id is d3 ); rightTree = createStageHeadTree(// indexTree("buildings", EMPTY_ID, null, 0), // indexTree("buildings/stores", "a5", "d31", 5)// new md id is d31 ); ObjectId newRepoRoot = command.call(); assertNotNull(newRepoRoot); // check all blobs have been moved from the index to the object database verifyRepositoryTree(NodeRef.ROOT, newRepoRoot); ImmutableMap<String, NodeRef> refsByPath = getTreeRefsByPath(newRepoRoot); assertEquals(set("buildings", "buildings/stores"), refsByPath.keySet()); assertEquals(id("d31"), refsByPath.get("buildings/stores").getMetadataId()); }
Preconditions.checkArgument(numFeatures != 0 || EMPTY_ID.equals(id), "for zero features trees use RevTree.EMPTY_TREE_ID"); final ObjectId treeId = id(id); final ObjectId metadataId = id(mdId); final String feturePrefix = NodeRef.nodeFromPath(path); RevTreeBuilder b = CanonicalTreeBuilder.create(db);