List of usage examples for org.eclipse.jgit.lib TreeFormatter insertTo
public ObjectId insertTo(ObjectInserter ins) throws IOException
From source file:com.microsoft.gittf.core.tasks.CreateCommitTask.java
License:Open Source License
private ObjectId createTree(final ObjectInserter repositoryInserter, final Map<CommitTreePath, CommitTreeEntry> tree) throws IOException { if (tree.isEmpty()) { return createEmptyTree(repositoryInserter); }/* w w w. j ava2 s . c om*/ TreeFormatter treeFormatter = new TreeFormatter(); for (Entry<CommitTreePath, CommitTreeEntry> entry : tree.entrySet()) { String name = entry.getKey().getName(); FileMode mode = entry.getValue().getFileMode(); ObjectId objectId = entry.getValue().getObjectID(); treeFormatter.append(name, mode, objectId); } return treeFormatter.insertTo(repositoryInserter); }
From source file:com.microsoft.gittf.core.tasks.CreateCommitTask.java
License:Open Source License
protected ObjectId createEmptyTree(ObjectInserter repositoryInserter) throws IOException { TreeFormatter treeFormatter = new TreeFormatter(); return treeFormatter.insertTo(repositoryInserter); }