diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-14 08:49:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-14 10:26:32 -0700 |
commit | 9da95bda74cf10e1475384a71fd20914c3b99784 (patch) | |
tree | fb145c3883d83c86ecf5bf7fa188937afe77b1e0 /notes-merge.c | |
parent | f4836570a7adbd8c70ad7a8edf6ae5a977647c06 (diff) |
hash: require hash algorithm in `oidread()` and `oidclr()`
Both `oidread()` and `oidclr()` use `the_repository` to derive the hash
function that shall be used. Require callers to pass in the hash
algorithm to get rid of this implicit dependency.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes-merge.c')
-rw-r--r-- | notes-merge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/notes-merge.c b/notes-merge.c index 6a9a139b12..801941c2d1 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -240,7 +240,7 @@ static void diff_tree_local(struct notes_merge_options *o, * (will be overwritten by following addition) */ if (oideq(&mp->local, &uninitialized)) - oidclr(&mp->local); + oidclr(&mp->local, the_repository->hash_algo); } else if (is_null_oid(&p->one->oid)) { /* addition */ /* * Either this is a true addition (1), or it is part @@ -556,7 +556,7 @@ int notes_merge(struct notes_merge_options *o, assert(o->local_ref && o->remote_ref); assert(!strcmp(o->local_ref, local_tree->ref)); - oidclr(result_oid); + oidclr(result_oid, the_repository->hash_algo); trace_printf("notes_merge(o->local_ref = %s, o->remote_ref = %s)\n", o->local_ref, o->remote_ref); @@ -579,7 +579,7 @@ int notes_merge(struct notes_merge_options *o, * unborn ref, perform the merge using an empty notes tree. */ if (!check_refname_format(o->remote_ref, 0)) { - oidclr(&remote_oid); + oidclr(&remote_oid, the_repository->hash_algo); remote = NULL; } else { die("Failed to resolve remote notes ref '%s'", |