Browse Source

Commit: Use Repository.newObjectInserter

Everyone else does.  This must have been a spot I missed during
some sort of squash while developing the series.

Change-Id: I62eae50b618f47ee33ad7cf71fc05b724f603201
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.9
Shawn O. Pearce 15 years ago
parent
commit
5aae041a81
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Commit.java

2
org.eclipse.jgit/src/org/eclipse/jgit/lib/Commit.java

@ -339,7 +339,7 @@ public class Commit implements Treeish {
public void commit() throws IOException { public void commit() throws IOException {
if (getCommitId() != null) if (getCommitId() != null)
throw new IllegalStateException(MessageFormat.format(JGitText.get().commitAlreadyExists, getCommitId())); throw new IllegalStateException(MessageFormat.format(JGitText.get().commitAlreadyExists, getCommitId()));
ObjectInserter odi = objdb.getObjectDatabase().newInserter(); ObjectInserter odi = objdb.newObjectInserter();
try { try {
ObjectId id = odi.insert(Constants.OBJ_COMMIT, odi.format(this)); ObjectId id = odi.insert(Constants.OBJ_COMMIT, odi.format(this));
odi.flush(); odi.flush();

Loading…
Cancel
Save