From b3dbf1981b8a0937253ef197d32921a4bc254bb2 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 14 Jun 2012 18:43:40 -0700 Subject: [PATCH] Use only a single ObjectInserter in ResolveMerger The base class supplies an ObjectInserter to its implementations by way of the getObjectInserter method. Tracking a second inserter instance doesn't match with the expected behavior. Change-Id: I78996bd06ef9028c8aa2e4e192ff647c43da847d --- .../src/org/eclipse/jgit/merge/ResolveMerger.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index 2c1aa6fbf..588d4b95b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -131,8 +131,6 @@ public class ResolveMerger extends ThreeWayMerger { private Map failingPaths = new HashMap(); - private ObjectInserter oi; - private boolean enterSubtree; private boolean inCore; @@ -155,7 +153,6 @@ public class ResolveMerger extends ThreeWayMerger { SupportedAlgorithm.HISTOGRAM); mergeAlgorithm = new MergeAlgorithm(DiffAlgorithm.getAlgorithm(diffAlg)); commitNames = new String[] { "BASE", "OURS", "THEIRS" }; - oi = getObjectInserter(); this.inCore = inCore; if (inCore) { @@ -226,7 +223,7 @@ public class ResolveMerger extends ThreeWayMerger { } if (getUnmergedPaths().isEmpty()) { - resultTree = dircache.writeTree(oi); + resultTree = dircache.writeTree(getObjectInserter()); return true; } else { resultTree = null; @@ -624,7 +621,8 @@ public class ResolveMerger extends ThreeWayMerger { dce.setLength((int) of.length()); InputStream is = new FileInputStream(of); try { - dce.setObjectId(oi.insert(Constants.OBJ_BLOB, of.length(), is)); + dce.setObjectId(getObjectInserter().insert( + Constants.OBJ_BLOB, of.length(), is)); } finally { is.close(); if (inCore)