]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/index-pack.c
index-pack: --verify
authorJunio C Hamano <gitster@pobox.com>
Thu, 3 Feb 2011 01:29:01 +0000 (17:29 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Feb 2011 07:29:03 +0000 (23:29 -0800)
commite337a04de298f8c3e64ee1a187423203406b9bae
treeb3838a13cda2101f500038632def6bfeec1a76a4
parentebcfb3791a53e0455bf8361046e3310993697a8e
index-pack: --verify

Given an existing .pack file and the .idx file that describes it,
this new mode of operation reads and re-index the packfile and makes
sure the existing .idx file matches the result byte-for-byte.

All the objects in the .pack file are validated during this operation as
well.  Unlike verify-pack, which visits each object described in the .idx
file in the SHA-1 order, index-pack efficiently exploits the delta-chain
to avoid rebuilding the objects that are used as the base of deltified
objects over and over again while validating the objects, resulting in
much quicker verification of the .pack file and its .idx file.

This version however cannot verify a .pack/.idx pair with a handcrafted v2
index that uses 64-bit offset representation for offsets that would fit
within 31-bit. You can create such an .idx file by giving a custom offset
to --index-version option to the command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c
csum-file.c
csum-file.h
pack-write.c
pack.h
t/t5302-pack-index.sh