From: Junio C Hamano Date: Wed, 20 Jan 2016 19:43:22 +0000 (-0800) Subject: Merge branch 'jk/pack-revindex' X-Git-Tag: v2.8.0-rc0~121 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fd1359158ac633cb3cba74ce5b380eddda38bfd;p=thirdparty%2Fgit.git Merge branch 'jk/pack-revindex' In-core storage of the reverse index for .pack files (which lets you go from a pack offset to an object name) has been streamlined. * jk/pack-revindex: pack-revindex: store entries directly in packed_git pack-revindex: drop hash table --- 4fd1359158ac633cb3cba74ce5b380eddda38bfd diff --cc cache.h index c63fcc113a,6603787442..bf00ce55f8 --- a/cache.h +++ b/cache.h @@@ -7,33 -7,14 +7,34 @@@ #include "advice.h" #include "gettext.h" #include "convert.h" +#include "trace.h" +#include "string-list.h" + #include "pack-revindex.h" #include SHA1_HEADER -#ifndef git_SHA_CTX -#define git_SHA_CTX SHA_CTX -#define git_SHA1_Init SHA1_Init -#define git_SHA1_Update SHA1_Update -#define git_SHA1_Final SHA1_Final +#ifndef platform_SHA_CTX +/* + * platform's underlying implementation of SHA-1; could be OpenSSL, + * blk_SHA, Apple CommonCrypto, etc... Note that including + * SHA1_HEADER may have already defined platform_SHA_CTX for our + * own implementations like block-sha1 and ppc-sha1, so we list + * the default for OpenSSL compatible SHA-1 implementations here. + */ +#define platform_SHA_CTX SHA_CTX +#define platform_SHA1_Init SHA1_Init +#define platform_SHA1_Update SHA1_Update +#define platform_SHA1_Final SHA1_Final +#endif + +#define git_SHA_CTX platform_SHA_CTX +#define git_SHA1_Init platform_SHA1_Init +#define git_SHA1_Update platform_SHA1_Update +#define git_SHA1_Final platform_SHA1_Final + +#ifdef SHA1_MAX_BLOCK_SIZE +#include "compat/sha1-chunked.h" +#undef git_SHA1_Update +#define git_SHA1_Update git_SHA1_Update_Chunked #endif #include @@@ -1296,9 -1116,9 +1297,10 @@@ extern struct packed_git int pack_fd; unsigned pack_local:1, pack_keep:1, + freshened:1, do_not_close:1; unsigned char sha1[20]; + struct revindex_entry *revindex; /* something like ".git/objects/pack/xxxxx.pack" */ char pack_name[FLEX_ARRAY]; /* more */ } *packed_git;