aboutsummaryrefslogtreecommitdiffstats
path: root/http-push.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-10 10:18:30 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-10 10:18:31 -0800
commit246569bf83f2a586268d26559c7d6ea54c9316b6 (patch)
tree29bdf8fd459a337adef85012b88d6ed71830a147 /http-push.c
parentMerge branch 'jt/gitlab-ci-base-fix' (diff)
parentglobal: adapt callers to use generic hash context helpers (diff)
downloadgit-246569bf83f2a586268d26559c7d6ea54c9316b6.tar.gz
git-246569bf83f2a586268d26559c7d6ea54c9316b6.zip
Merge branch 'ps/hash-cleanup'
Further code clean-up on the use of hash functions. Now the context object knows what hash function it is working with. * ps/hash-cleanup: global: adapt callers to use generic hash context helpers hash: provide generic wrappers to update hash contexts hash: stop typedeffing the hash context hash: convert hashing context to a structure
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/http-push.c b/http-push.c
index 43da1c7cd3..1b030d96f4 100644
--- a/http-push.c
+++ b/http-push.c
@@ -760,7 +760,7 @@ static void handle_lockprop_ctx(struct xml_ctx *ctx, int tag_closed)
static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
{
struct remote_lock *lock = (struct remote_lock *)ctx->userData;
- git_hash_ctx hash_ctx;
+ struct git_hash_ctx hash_ctx;
unsigned char lock_token_hash[GIT_MAX_RAWSZ];
if (tag_closed && ctx->cdata) {
@@ -774,8 +774,8 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
lock->token = xstrdup(ctx->cdata);
the_hash_algo->init_fn(&hash_ctx);
- the_hash_algo->update_fn(&hash_ctx, lock->token, strlen(lock->token));
- the_hash_algo->final_fn(lock_token_hash, &hash_ctx);
+ git_hash_update(&hash_ctx, lock->token, strlen(lock->token));
+ git_hash_final(lock_token_hash, &hash_ctx);
lock->tmpfile_suffix[0] = '_';
memcpy(lock->tmpfile_suffix + 1, hash_to_hex(lock_token_hash), the_hash_algo->hexsz);