diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-12-18 20:55:09 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-12-18 20:55:09 +0900 |
| commit | 00f117fafea4a43e95425c4abdb8cb58ec8e76b4 (patch) | |
| tree | a860396d3e681c5bb5af5b154752ac2062ab35e7 /object-file.c | |
| parent | c4a0c8845e2426375ad257b6c221a3a7d92ecfda (diff) | |
| parent | a650ad996db85b64643970dd7dc5920f989260a0 (diff) | |
| download | git-00f117fafea4a43e95425c4abdb8cb58ec8e76b4.tar.xz | |
Merge branch 'jc/object-read-stream-fix' into ps/read-object-info-improvements
* jc/object-read-stream-fix:
odb: do not use "blank" substitute for NULL
Diffstat (limited to 'object-file.c')
| -rw-r--r-- | object-file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/object-file.c b/object-file.c index af1c3f972d..6280e42f34 100644 --- a/object-file.c +++ b/object-file.c @@ -426,7 +426,7 @@ int odb_source_loose_read_object_info(struct odb_source *source, unsigned long size_scratch; enum object_type type_scratch; - if (oi->delta_base_oid) + if (oi && oi->delta_base_oid) oidclr(oi->delta_base_oid, source->odb->repo->hash_algo); /* @@ -437,13 +437,13 @@ int odb_source_loose_read_object_info(struct odb_source *source, * return value implicitly indicates whether the * object even exists. */ - if (!oi->typep && !oi->sizep && !oi->contentp) { + if (!oi || (!oi->typep && !oi->sizep && !oi->contentp)) { struct stat st; - if (!oi->disk_sizep && (flags & OBJECT_INFO_QUICK)) + if ((!oi || !oi->disk_sizep) && (flags & OBJECT_INFO_QUICK)) return quick_has_loose(source->loose, oid) ? 0 : -1; if (stat_loose_object(source->loose, oid, &st, &path) < 0) return -1; - if (oi->disk_sizep) + if (oi && oi->disk_sizep) *oi->disk_sizep = st.st_size; return 0; } |
