On Sun, Jul 05, 2026 at 08:01:05PM -0400, Jeff King wrote:
That by itself is enough to make:
algo->init_fn(&ctx);
git_hash_update(&ctx, ...);
git_hash_final(out, &ctx);
...
git_hash_discard(&ctx);
safe.
Actually, that's not quite true. Setting the active flag happens in
git_hash_init() in that model. But many callers use algo->init_fn()
directly instead. They'd all need to be adjusted to use git_hash_init().
I don't think there's any reason they should avoid it, and it's mostly
from inertia that they use the bare function pointer.
-Peff