summaryrefslogtreecommitdiffstats
path: root/sequencer.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-14 08:49:54 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-14 19:26:32 +0200
commit9da95bda74cf10e1475384a71fd20914c3b99784 (patch)
treefb145c3883d83c86ecf5bf7fa188937afe77b1e0 /sequencer.c
parenthash: require hash algorithm in `hasheq()`, `hashcmp()` and `hashclr()` (diff)
downloadgit-9da95bda74cf10e1475384a71fd20914c3b99784.tar.xz
git-9da95bda74cf10e1475384a71fd20914c3b99784.zip
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 'sequencer.c')
-rw-r--r--sequencer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 30513e87bf..68d62a12ff 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3334,12 +3334,12 @@ static int rollback_is_safe(void)
strbuf_release(&sb);
}
else if (errno == ENOENT)
- oidclr(&expected_head);
+ oidclr(&expected_head, the_repository->hash_algo);
else
die_errno(_("could not read '%s'"), git_path_abort_safety_file());
if (repo_get_oid(the_repository, "HEAD", &actual_head))
- oidclr(&actual_head);
+ oidclr(&actual_head, the_repository->hash_algo);
return oideq(&actual_head, &expected_head);
}