summaryrefslogtreecommitdiff
path: root/csum-file.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 /csum-file.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 'csum-file.h')
-rw-r--r--csum-file.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/csum-file.h b/csum-file.h
index 294add2..6a7967c 100644
--- a/csum-file.h
+++ b/csum-file.h
@@ -6,6 +6,7 @@ struct progress;
/* A SHA1-protected file */
struct sha1file {
int fd;
+ int check_fd;
unsigned int offset;
git_SHA_CTX ctx;
off_t total;
@@ -21,6 +22,7 @@ struct sha1file {
#define CSUM_FSYNC 2
extern struct sha1file *sha1fd(int fd, const char *name);
+extern struct sha1file *sha1fd_check(const char *name);
extern struct sha1file *sha1fd_throughput(int fd, const char *name, struct progress *tp);
extern int sha1close(struct sha1file *, unsigned char *, unsigned int);
extern int sha1write(struct sha1file *, void *, unsigned int);