]> source.dussan.org Git - jgit.git/commit
Fix dumb transport push 98/2698/2
authorShawn O. Pearce <spearce@spearce.org>
Mon, 14 Mar 2011 14:06:35 +0000 (07:06 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 14 Mar 2011 15:01:51 +0000 (08:01 -0700)
commit65f9a6e58bd9296cbbe1cffc7cf079fd65991686
tree2552786036b778f87fa73ba91d2fb642ed714383
parent9b941d017228a236d733abce183b2fecef69d682
Fix dumb transport push

PackWriter incorrectly returned 0 from getObjectsNumber() when the
pack has not been written yet. This caused dumb transports like
amazon-s3:// and sftp:// to abort early and never write out a pack,
under the assumption that the pack had no objects.

Until the pack header is written to the output stream, compute the
current object count each time it is requested. Once the header is
started, use the object count from the stats object.

Change-Id: I041a2368ae0cfe6f649ec28658d41a6355933900
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java