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 19:26:32 +0200 |
commit | 9da95bda74cf10e1475384a71fd20914c3b99784 (patch) | |
tree | fb145c3883d83c86ecf5bf7fa188937afe77b1e0 /diff-lib.c | |
parent | hash: require hash algorithm in `hasheq()`, `hashcmp()` and `hashclr()` (diff) | |
download | git-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 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c index 5a5a50c5a1..3fb8d79fef 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -160,7 +160,7 @@ void run_diff_files(struct rev_info *revs, unsigned int option) dpath->next = NULL; memcpy(dpath->path, ce->name, path_len); dpath->path[path_len] = '\0'; - oidclr(&dpath->oid); + oidclr(&dpath->oid, the_repository->hash_algo); memset(&(dpath->parent[0]), 0, sizeof(struct combine_diff_parent)*5); @@ -412,7 +412,7 @@ static int show_modified(struct rev_info *revs, memcpy(p->path, new_entry->name, pathlen); p->path[pathlen] = 0; p->mode = mode; - oidclr(&p->oid); + oidclr(&p->oid, the_repository->hash_algo); memset(p->parent, 0, 2 * sizeof(struct combine_diff_parent)); p->parent[0].status = DIFF_STATUS_MODIFIED; p->parent[0].mode = new_entry->ce_mode; |