Allow PackWriter to prepare object list and compute name before writing
When we are writing a pack for a dumb protocol transport we want to
get the name of the pack prior to generating its output stream. This
permits us to open the pack stream directly under its final name and
write into it without needing to issue a rename in the middle of the
process. By splitting the pack preparing phase from the writing phase
we are able to request computeName() between the two stages and create
the OutputStream based upon the result.
To improve performance we also now buffer what we write to the pack
stream, if the pack stream was not already a buffered stream.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>