index-pack: Avoid disk corruption in objects appended to thin packs
commite8634851f46e1b54db17a45a9008b6e6284f34ce
authorShawn O. Pearce <spearce@spearce.org>
Fri, 29 Aug 2008 05:54:10 +0000 (28 22:54 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Fri, 29 Aug 2008 09:17:36 +0000 (29 11:17 +0200)
treef3df5bdf61cb6144072f4d91d783a5d0c6f0ee56
parent089eab66c415fc706d6947e401d9996a6c3b1ba1
index-pack: Avoid disk corruption in objects appended to thin packs

When we are appending onto a thin pack we need to make sure the whole
object we wrote into the pack is what is there when we re-read the
pack to compute the final footer.

Nicolas Pitre pointed out the need to perform this sort of compare
in C Git.  We missed it in my first round of index-pack improvements.

We also now take advantage of "roughly" block aligned reads during
the fixup operation.  4k is a popular filesystem block size and by
arranging the code a little differently we can always perform reads
on 4k alignments within the file.  This should make it easier for
the OS to move data to us.

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/transport/IndexPack.java