refs/files: remove references to `the_hash_algo`
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>
Patrick Steinhardt committed
May 17, 2024 at 10:19 UTC
c1026b9d7dd627d014afd1ddc0c1d17044eb4785
1 file changed
+2
-2
refs/files-backend.c
+2
-2
@@ -1822,7 +1822,7 @@ static int write_ref_to_lockfile(struct files_ref_store *refs,
1822
}
1823
}
1824
fd = get_lock_file_fd(&lock->lk);
1825
- if (write_in_full(fd, oid_to_hex(oid), the_hash_algo->hexsz) < 0 ||
1825
+ if (write_in_full(fd, oid_to_hex(oid), refs->base.repo->hash_algo->hexsz) < 0 ||
1826
write_in_full(fd, &term, 1) < 0 ||
1827
fsync_component(FSYNC_COMPONENT_REFERENCE, get_lock_file_fd(&lock->lk)) < 0 ||
1828
close_ref_gently(lock) < 0) {
@@ -3223,7 +3223,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
3223
rollback_lock_file(&reflog_lock);
3224
} else if (update &&
3225
(write_in_full(get_lock_file_fd(&lock->lk),
3226
- oid_to_hex(&cb.last_kept_oid), the_hash_algo->hexsz) < 0 ||
3226
+ oid_to_hex(&cb.last_kept_oid), refs->base.repo->hash_algo->hexsz) < 0 ||
3227
write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 0 ||
3228
close_ref_gently(lock) < 0)) {
3229
status |= error("couldn't write %s",