Refactor PackWriter to hold onto the sorted object list
commitbf871429cdb92e4d60a3995f8b6c41daacc4d34d
authorShawn O. Pearce <spearce@spearce.org>
Sun, 29 Jun 2008 07:59:14 +0000 (29 03:59 -0400)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Mon, 30 Jun 2008 22:46:21 +0000 (1 00:46 +0200)
tree132a79e3c56971936e585247f4b7a025fa37367f
parentb9608d1df7104259a2c991fb99f6884a09a45c87
Refactor PackWriter to hold onto the sorted object list

When creating pack files we sometimes need the sorted object list
of all contents for two reasons.  The first is to get the name of
the pack, which computeName() returns today.  The other reason is
to generate a corresponding .idx file for this pack, to support
random access into the data.

Since not all uses of PackWriter require the sorted object name list
(for example streaming the pack to a network socket) the sorting is
done on demand, and cached to avoid needing to do it a second time.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java