summaryrefslogtreecommitdiff
path: root/pack.h
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-04-19 07:23:07 -0700
committerJunio C Hamano <gitster@pobox.com>2010-04-19 17:56:13 -0700
commit9b0aa728705439ca4b4e7ec845f79f8487059320 (patch)
tree519fe764ab29f4ab7f87c9baccff601a5e2a9313 /pack.h
parentfa5fc15d6ecfb9452c578bb4c80e98ccca12750c (diff)
downloadgit-9b0aa728705439ca4b4e7ec845f79f8487059320.tar.gz
Extract verify_pack_index for reuse from verify_pack
The dumb HTTP transport should verify an index is completely valid before trying to use it. That requires checking the header/footer but also checking the complete content SHA-1. All of this logic is already in the front half of verify_pack, so pull it out into a new function that can be reused. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack.h')
-rw-r--r--pack.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/pack.h b/pack.h
index b759a23d4d..880f9c2930 100644
--- a/pack.h
+++ b/pack.h
@@ -57,6 +57,7 @@ struct pack_idx_entry {
extern const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, unsigned char *sha1);
extern int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr);
+extern int verify_pack_index(struct packed_git *);
extern int verify_pack(struct packed_git *);
extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t);
extern char *index_pack_lockfile(int fd);