Validate the pack's footer checksum matches that in the index
If the SHA-1 checksum of the entire pack content does not match the
checksum stored in the corresponding *.idx file we cannot use the
index, as the offsets recorded with it are most likely incorrect.
This situation can arise if another application repacks the pack
with different compression settings, but puts the same set of
objects into it. The offsets are going to be different, but the
resulting pack file and index file names will be the same. If we
had previously read the old index into memory, but the pack isn't
a match anymore, we can't safely access this pack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>