Skip to content

Commit c1026b9

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c9e9723 commit c1026b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

refs/files-backend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ static int write_ref_to_lockfile(struct files_ref_store *refs,
18221822
}
18231823
}
18241824
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 ||
18261826
write_in_full(fd, &term, 1) < 0 ||
18271827
fsync_component(FSYNC_COMPONENT_REFERENCE, get_lock_file_fd(&lock->lk)) < 0 ||
18281828
close_ref_gently(lock) < 0) {
@@ -3223,7 +3223,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
32233223
rollback_lock_file(&reflog_lock);
32243224
} else if (update &&
32253225
(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 ||
32273227
write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 0 ||
32283228
close_ref_gently(lock) < 0)) {
32293229
status |= error("couldn't write %s",

0 commit comments

Comments
 (0)