]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/git-hash-cleanups'
authorJunio C Hamano <gitster@pobox.com>
Fri, 17 Jul 2026 06:05:48 +0000 (23:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jul 2026 06:05:48 +0000 (23:05 -0700)
The 'git_hash_*()' wrappers have been updated to be used consistently
across the codebase instead of direct calls to members of 'struct
git_hash_algo', and 'git_hash_discard()' has been made idempotent to
simplify cleanups.

* jk/git-hash-cleanups:
  hash: check ctx->active flag in all wrapper functions
  http: use idempotent git_hash_discard()
  csum-file: use idempotent git_hash_discard()
  hash: make git_hash_discard() idempotent
  hash: document function pointers and wrappers
  hash: convert remaining direct function calls
  hash: use git_hash_init() consistently

1  2 
builtin/index-pack.c
object-file.c
read-cache.c

Simple merge
diff --cc object-file.c
index e3c68cfb66c700102dc7163aa018a84404b675ff,304b83f8597fa3a1c048f76595e903ef4efc749f..93602f8c50a8589cb1c3839af460d469bc11c2b1
@@@ -316,11 -316,11 +316,11 @@@ int parse_loose_header(const char *hdr
  }
  
  static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_ctx *c,
 -                           const void *buf, unsigned long len,
 +                           const void *buf, size_t len,
                             struct object_id *oid,
 -                           char *hdr, int *hdrlen)
 +                           char *hdr, size_t *hdrlen)
  {
-       algo->init_fn(c);
+       git_hash_init(c, algo);
        git_hash_update(c, hdr, *hdrlen);
        git_hash_update(c, buf, len);
        git_hash_final_oid(oid, c);
diff --cc read-cache.c
Simple merge