diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-01-31 13:55:31 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-01-31 10:06:11 -0800 |
| commit | 0578f1e66aa381356bfe2f53decf3864d88d23d3 (patch) | |
| tree | ca26e9efacec048463fe529f72998ba59924f479 /trace2 | |
| parent | b2755c15e2359c5436de062bf33a155a99c72c03 (diff) | |
| download | git-0578f1e66aa381356bfe2f53decf3864d88d23d3.tar.gz | |
global: adapt callers to use generic hash context helpers
Adapt callers to use generic hash context helpers instead of using the
hash algorithm to update them. This makes the callsites easier to reason
about and removes the possibility that the wrong hash algorithm is used
to update the hash context's state. And as a nice side effect this also
gets rid of a bunch of users of `the_hash_algo`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2')
| -rw-r--r-- | trace2/tr2_sid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trace2/tr2_sid.c b/trace2/tr2_sid.c index c42696ef52..1c1d27b0ee 100644 --- a/trace2/tr2_sid.c +++ b/trace2/tr2_sid.c @@ -46,8 +46,8 @@ static void tr2_sid_append_my_sid_component(void) strbuf_add(&tr2sid_buf, "Localhost", 9); else { algo->init_fn(&ctx); - algo->update_fn(&ctx, hostname, strlen(hostname)); - algo->final_fn(hash, &ctx); + git_hash_update(&ctx, hostname, strlen(hostname)); + git_hash_final(hash, &ctx); hash_to_hex_algop_r(hex, hash, algo); strbuf_addch(&tr2sid_buf, 'H'); strbuf_add(&tr2sid_buf, hex, 8); |
