summaryrefslogtreecommitdiff
path: root/pack.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-02-03 01:29:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-02-28 07:29:03 (GMT)
commite337a04de298f8c3e64ee1a187423203406b9bae (patch)
treeb3838a13cda2101f500038632def6bfeec1a76a4 /pack.h
parentebcfb3791a53e0455bf8361046e3310993697a8e (diff)
downloadgit-e337a04de298f8c3e64ee1a187423203406b9bae.zip
git-e337a04de298f8c3e64ee1a187423203406b9bae.tar.gz
git-e337a04de298f8c3e64ee1a187423203406b9bae.tar.bz2
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>
Diffstat (limited to 'pack.h')
-rw-r--r--pack.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/pack.h b/pack.h
index 953f57e..dddafdd 100644
--- a/pack.h
+++ b/pack.h
@@ -35,6 +35,10 @@ struct pack_header {
#define PACK_IDX_SIGNATURE 0xff744f63 /* "\377tOc" */
struct pack_idx_option {
+ unsigned flags;
+ /* flag bits */
+#define WRITE_IDX_VERIFY 01
+
uint32_t version;
uint32_t off32_limit;
};