From: Junio C Hamano Date: Fri, 17 Jul 2026 06:05:48 +0000 (-0700) Subject: Merge branch 'jk/git-hash-cleanups' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7e0872c6a0899903bf5f530835999dbf629e5b8;p=thirdparty%2Fgit.git Merge branch 'jk/git-hash-cleanups' The 'git_hash_*()' wrappers have been updated to be used consistently across the codebase instead of direct calls to members of 'struct git_hash_algo', and 'git_hash_discard()' has been made idempotent to simplify cleanups. * jk/git-hash-cleanups: hash: check ctx->active flag in all wrapper functions http: use idempotent git_hash_discard() csum-file: use idempotent git_hash_discard() hash: make git_hash_discard() idempotent hash: document function pointers and wrappers hash: convert remaining direct function calls hash: use git_hash_init() consistently --- e7e0872c6a0899903bf5f530835999dbf629e5b8 diff --cc object-file.c index e3c68cfb66,304b83f859..93602f8c50 --- a/object-file.c +++ b/object-file.c @@@ -316,11 -316,11 +316,11 @@@ int parse_loose_header(const char *hdr } static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_ctx *c, - const void *buf, unsigned long len, + const void *buf, size_t len, struct object_id *oid, - char *hdr, int *hdrlen) + char *hdr, size_t *hdrlen) { - algo->init_fn(c); + git_hash_init(c, algo); git_hash_update(c, hdr, *hdrlen); git_hash_update(c, buf, len); git_hash_final_oid(oid, c);