]> git.ipfire.org Git - thirdparty/git.git/commit
hash: use git_hash_init() consistently
authorJeff King <peff@peff.net>
Wed, 8 Jul 2026 03:52:49 +0000 (23:52 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Jul 2026 04:56:00 +0000 (21:56 -0700)
commit9b204b825bcaf656ea6a2cb0657ef907db21a0e6
treec0ba563039ba5a426c8be84a121dbde4c841667f
parentf08ece0e2c76afc5a1b51afe0f3a6d0021ae1388
hash: use git_hash_init() consistently

We'd like to add more logic to git_hash_init(), but many callers skip it
and call algop->init_fn() directly. Let's make sure we're consistently
using the wrapper by adding a coccinelle rule.

Besides the coccinelle file itself, this is a purely mechanical
conversion based on the patch it generates. There should be no bare
init_fn() calls left (except for the one in the wrapper).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 files changed:
builtin/fast-import.c
builtin/index-pack.c
builtin/patch-id.c
builtin/receive-pack.c
builtin/submodule--helper.c
builtin/unpack-objects.c
csum-file.c
diff.c
http-push.c
http.c
object-file.c
pack-check.c
pack-write.c
read-cache.c
rerere.c
t/helper/test-hash-speed.c
t/helper/test-hash.c
t/helper/test-synthesize.c
t/unit-tests/u-hash.c
tools/coccinelle/hash.cocci [new file with mode: 0644]
trace2/tr2_sid.c