Ensure the ObjectInserter flushes after a merge

If this does not happen some databases may discard
objects and not make them available.

Change-Id: I347b3c3724db52c8a6c09f4804071497a3a377ab
This commit is contained in:
Shawn O. Pearce 2011-10-26 14:42:51 -07:00
parent 34f678643c
commit b24a61272a
1 changed files with 4 additions and 1 deletions

View File

@ -153,7 +153,10 @@ public boolean merge(final AnyObjectId... tips) throws IOException {
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();