]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs/files: remove references to `the_hash_algo`
authorPatrick Steinhardt <ps@pks.im>
Fri, 17 May 2024 08:19:24 +0000 (10:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 17:33:40 +0000 (10:33 -0700)
Remove references to `the_hash_algo` in favor of the hash algo specified
by the repository associated with the files ref store.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c

index 235c8580d1f166a60c3cb0e762c3e00005efb2ed..735a5acefe44e2ab3a63dc39fab64d206317a6ef 100644 (file)
@@ -1822,7 +1822,7 @@ static int write_ref_to_lockfile(struct files_ref_store *refs,
                }
        }
        fd = get_lock_file_fd(&lock->lk);
-       if (write_in_full(fd, oid_to_hex(oid), the_hash_algo->hexsz) < 0 ||
+       if (write_in_full(fd, oid_to_hex(oid), refs->base.repo->hash_algo->hexsz) < 0 ||
            write_in_full(fd, &term, 1) < 0 ||
            fsync_component(FSYNC_COMPONENT_REFERENCE, get_lock_file_fd(&lock->lk)) < 0 ||
            close_ref_gently(lock) < 0) {
@@ -3223,7 +3223,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
                        rollback_lock_file(&reflog_lock);
                } else if (update &&
                           (write_in_full(get_lock_file_fd(&lock->lk),
-                               oid_to_hex(&cb.last_kept_oid), the_hash_algo->hexsz) < 0 ||
+                               oid_to_hex(&cb.last_kept_oid), refs->base.repo->hash_algo->hexsz) < 0 ||
                            write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 0 ||
                            close_ref_gently(lock) < 0)) {
                        status |= error("couldn't write %s",