Call inserter.flush() when creating code review notes

Failing to do this can cause the notes blobs to not get written to
storage, particularly with JGit's DfsInserter.

Change-Id: I28168374ddf9f89f5107a91bfba44f345ef395cf
This commit is contained in:
Dave Borowitz
2012-10-10 15:00:44 -07:00
parent 1d4a455fb9
commit 38bc1cf6a7

View File

@@ -117,6 +117,7 @@ public class CreateCodeReviewNotes {
NotesBranchUtil notesBranchUtil = notesBranchUtilFactory.create(db);
notesBranchUtil.commitAllNotes(notes, REFS_NOTES_REVIEW, author,
message.toString());
inserter.flush();
} catch (IOException e) {
throw new CodeReviewNoteCreationException(e);
} catch (ConcurrentRefUpdateException e) {
@@ -151,6 +152,7 @@ public class CreateCodeReviewNotes {
NotesBranchUtil notesBranchUtil = notesBranchUtilFactory.create(db);
notesBranchUtil.commitAllNotes(notes, REFS_NOTES_REVIEW, author,
commitMessage);
inserter.flush();
} catch (ConcurrentRefUpdateException e) {
throw new CodeReviewNoteCreationException(e);
} finally {