Merge branch 'bc/object-id'
Conversion from uchar[40] to struct object_id continues. * bc/object-id: pretty: switch hard-coded constants to the_hash_algo sha1-file: convert constants to uses of the_hash_algo log-tree: switch GIT_SHA1_HEXSZ to the_hash_algo->hexsz diff: switch GIT_SHA1_HEXSZ to use the_hash_algo builtin/merge-recursive: make hash independent builtin/merge: switch to use the_hash_algo builtin/fmt-merge-msg: make hash independent builtin/update-index: simplify parsing of cacheinfo builtin/update-index: convert to using the_hash_algo refs/files-backend: use the_hash_algo for writing refs sha1-name: use the_hash_algo when parsing object names strbuf: allocate space with GIT_MAX_HEXSZ commit: express tree entry constants in terms of the_hash_algo hex: switch to using the_hash_algo tree-walk: replace hard-coded constants with the_hash_algo cache: update object ID functions for the_hash_algo
This commit is contained in:
@ -1667,7 +1667,7 @@ static int write_ref_to_lockfile(struct ref_lock *lock,
|
||||
return -1;
|
||||
}
|
||||
fd = get_lock_file_fd(&lock->lk);
|
||||
if (write_in_full(fd, oid_to_hex(oid), GIT_SHA1_HEXSZ) < 0 ||
|
||||
if (write_in_full(fd, oid_to_hex(oid), the_hash_algo->hexsz) < 0 ||
|
||||
write_in_full(fd, &term, 1) < 0 ||
|
||||
close_ref_gently(lock) < 0) {
|
||||
strbuf_addf(err,
|
||||
@ -3061,7 +3061,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), GIT_SHA1_HEXSZ) < 0 ||
|
||||
oid_to_hex(&cb.last_kept_oid), the_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",
|
||||
|
Reference in New Issue
Block a user