/** * Creates internal hive format version info. * * @throws IOException */ private void createVersionInfo() throws IOException { final byte[] bytes = CURRENTVERSION.getBytes(); final Tree root = new Tree(repository); FileTreeEntry versionFile = root.addFile(VERSION_PATH); versionFile.setId(writeBytes(bytes)); Commit commit = commitTree(root); updateHead(commit); }
private VersionImpl updateTree(final Tree root, final String key, final byte[] data) throws IOException { ObjectId objectId = writeBytes(data); FileTreeEntry fileTreeEntry = root.addFile(key + "/" + objectId.name()); fileTreeEntry.setId(objectId); Commit commit = commitTree(root); updateHead(commit); VersionImpl version = new VersionImpl(commit, key, fileTreeEntry); return version; }