private ObjectId buildTree(HashMap<String, String> headEntries)
throws IOException {
DirCache lockDirCache = DirCache.newInCore();
// assertTrue(lockDirCache.lock());
DirCacheEditor editor = lockDirCache.editor();
if (headEntries != null) {
for (java.util.Map.Entry<String, String> e : headEntries.entrySet()) {
AddEdit addEdit = new AddEdit(e.getKey(),
genSha1(e.getValue()), e.getValue().length());
editor.add(addEdit);