diff options
| author | René Scharfe <l.s.r@web.de> | 2026-02-09 20:24:52 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-10 08:16:14 -0800 |
| commit | af5706f033466b2a4f17d83168bf0bd021197c1d (patch) | |
| tree | 4a32d8a3b5aa0716ab6ec197e2264213862865a2 /xdiff-interface.c | |
| parent | 67ad42147a7acc2af6074753ebd03d904476118f (diff) | |
| download | git-af5706f033466b2a4f17d83168bf0bd021197c1d.tar.xz | |
xdiff-interface: stop using the_repository
Use the algorithm-agnostic is_null_oid() and push the dependency of
read_mmblob() on the_repository->objects to its callers. This allows it
to be used with arbitrary object databases.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff-interface.c')
| -rw-r--r-- | xdiff-interface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xdiff-interface.c b/xdiff-interface.c index 1a35556380..f043330f2a 100644 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@ -1,4 +1,3 @@ -#define USE_THE_REPOSITORY_VARIABLE #define DISABLE_SIGN_COMPARE_WARNINGS #include "git-compat-util.h" @@ -177,18 +176,19 @@ int read_mmfile(mmfile_t *ptr, const char *filename) return 0; } -void read_mmblob(mmfile_t *ptr, const struct object_id *oid) +void read_mmblob(mmfile_t *ptr, struct object_database *odb, + const struct object_id *oid) { unsigned long size; enum object_type type; - if (oideq(oid, null_oid(the_hash_algo))) { + if (is_null_oid(oid)) { ptr->ptr = xstrdup(""); ptr->size = 0; return; } - ptr->ptr = odb_read_object(the_repository->objects, oid, &type, &size); + ptr->ptr = odb_read_object(odb, oid, &type, &size); if (!ptr->ptr || type != OBJ_BLOB) die("unable to read blob object %s", oid_to_hex(oid)); ptr->size = size; |
