]> source.dussan.org Git - jgit.git/commitdiff
Ensure the ObjectInserter flushes after a merge 12/4412/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 26 Oct 2011 21:42:51 +0000 (14:42 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 27 Oct 2011 03:34:52 +0000 (20:34 -0700)
If this does not happen some databases may discard
objects and not make them available.

Change-Id: I347b3c3724db52c8a6c09f4804071497a3a377ab

org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java

index 55ac999cd487926192058acf10204c99f28cef55..e47192bddb2f6ea7c769082de288dda844eee0ad 100644 (file)
@@ -153,7 +153,10 @@ public abstract class Merger {
                        sourceTrees[i] = walk.parseTree(sourceObjects[i]);
 
                try {
-                       return mergeImpl();
+                       boolean ok = mergeImpl();
+                       if (ok && inserter != null)
+                               inserter.flush();
+                       return ok;
                } finally {
                        if (inserter != null)
                                inserter.release();