if (head == null || head.getBytes().length == 0) {
// assume virgin repository
byte[] rawHead = longToBytes(++headCounter);
head = new Id(rawHead);
Id rootNodeId = pm.writeNode(new MutableNode(this, "/"));
MutableCommit initialCommit = new MutableCommit();
initialCommit.setCommitTS(System.currentTimeMillis());
initialCommit.setRootNodeId(rootNodeId);
pm.writeCommit(head, initialCommit);
pm.writeHead(head);