]> source.dussan.org Git - jgit.git/commit
Teach mergers to use ObjectInserter.newReader() 03/12503/10
authorDave Borowitz <dborowitz@google.com>
Fri, 3 May 2013 17:54:38 +0000 (10:54 -0700)
committerShawn Pearce <spearce@spearce.org>
Wed, 13 Aug 2014 17:39:57 +0000 (10:39 -0700)
commit0ab3f43c8542c6c3b7604ac938bf3dcbcc12caa8
tree0b02ed8011c96efdbe98005ab706ef8296a90918
parente1856dbf44a91112e6b2a5d185128f46fe0d8116
Teach mergers to use ObjectInserter.newReader()

This allows the RecursiveMerger to iteratively create new merge bases
without necessarily flushing packs to storage in the DFS case;
flushing only need happen at the end of the whole merge process.

Since Merger's walk now depends on its inserter, we need to construct
an inserter at Merger construction time.  This should not be a
significant increase in overhead since unused inserters don't use any
resources (beyond a reference to the Repository).

We also must release and recreate the walk whenever setObjectInserter
is called, which can break usages where setObjectInserter is called in
the middle of stateful operations on the walk.  No usages of this
method within JGit currently do this; the inserter is only ever set
before any stateful walk operations happen.

Change-Id: I9682a6aa4a2c37dccef8e163f132ddb791d79103
org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java