Implement CRC32 computation during PackWriter
commitfea0546e61dd90f2117c70230d51ba64c07e2ef1
authorShawn O. Pearce <spearce@spearce.org>
Thu, 26 Mar 2009 01:21:52 +0000 (25 18:21 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 26 Mar 2009 21:06:22 +0000 (26 22:06 +0100)
tree130cadd7846136d929266fb769eeab58b674874e
parent2f3977c13c05bf9c6200e535b9e083218af38371
Implement CRC32 computation during PackWriter

To correctly create a v2 index file for a pack we must compute the
CRC32 code for each object entry as they are written out, otherwise
the CRC32 table will be full of 0's, and fail verification if the
resulting pack were to be reused.

Reported-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackWriterTest.java
org.spearce.jgit/src/org/spearce/jgit/lib/PackOutputStream.java [moved from org.spearce.jgit/src/org/spearce/jgit/util/CountingOutputStream.java with 61% similarity]
org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java