The previous patch added a coccinelle rule to make sure callers always use git_hash_init() rather than direct function pointers from the algo struct. Let's do the same for the rest of the git_hash_*() wrappers. I split these out because they're a bit different: they implicitly use the algop pointer in the git_hash_ctx. So when we convert: -algo->update_fn(&ctx, buf, len); +git_hash_update(&ctx, buf, len); we drop the reference to algo entirely! But this is always going to be the right thing. If "algo" does not match what is in ctx.algop, then we'd already be invoking undefined behavior. So in addition to making it possible to add more logic to the git_hash_*() functions, we're avoiding the need to pass around the extra algo pointer and make sure that it matches what's in "ctx". The rest of the patch is the mechanical application of that coccinelle patch, plus a minor cleanup in test-synthesize.c to drop a now-unused function parameter (since we don't have to pass around the algo separately anymore). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
|---|---|---|
| .. | ||
| coccinelle | ||
| update-unicode | ||
| README.md | ||
| check-builtins.sh | ||
| coverage-diff.sh | ||
| detect-compiler | ||
| generate-cmdlist.sh | ||
| generate-configlist.sh | ||
| generate-hooklist.sh | ||
| generate-perl.sh | ||
| generate-python.sh | ||
| generate-script.sh | ||
| meson.build | ||
| precompiled.h | ||
README.md
Developer Tooling
This directory is expected to contain all sorts of tooling that relates to our build infrastructure. This includes scripts and inputs required by our build systems, but also scripts that developers are expected to run manually.