cache.h: move hash/oid functions to hash.h
authorJeff King <peff@peff.net>
Fri, 4 Dec 2020 18:51:39 +0000 (13:51 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Dec 2020 21:55:14 +0000 (13:55 -0800)
commit3fa6f2aa57e997ff2e665d83335a8f1078b94cb8
tree5a4bd75c4f626d5b4eccffe3fdc4ecbcf099b346
parent3ea922fc8b19d8cdf967ca7b3229856e6326d099
cache.h: move hash/oid functions to hash.h

We define git_hash_algo and object_id in hash.h, but most of the utility
functions are declared in the main cache.h. Let's move them to hash.h
along with their struct definitions. This cleans up cache.h a bit, but
also avoids circular dependencies when other headers need to know about
these functions (e.g., if oid-array.h were to have an inline that used
oideq(), it couldn't include cache.h because it is itself included by
cache.h).

No including C files should be affected, because hash.h is always
included in cache.h already.

We do have to mention repository.h at the top of hash.h, though, since
we depend on the_repository in some of our inline functions.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
hash.h