diff --git a/odb/streaming.c b/odb/streaming.c index 4a4474f891a07f..177f989eed1844 100644 --- a/odb/streaming.c +++ b/odb/streaming.c @@ -7,6 +7,7 @@ #include "environment.h" #include "repository.h" #include "object-file.h" +#include "gvfs.h" #include "odb.h" #include "odb/streaming.h" #include "replace-object.h" @@ -158,13 +159,14 @@ static int open_istream_incore(struct odb_read_stream **out, .base.read = read_istream_incore, }; struct odb_incore_read_stream *st; + unsigned flags = gvfs_config_is_set(odb->repo, GVFS_MISSING_OK) ? + 0 : OBJECT_INFO_DIE_IF_CORRUPT; int ret; oi.typep = &stream.base.type; oi.sizep = &stream.base.size; oi.contentp = (void **)&stream.buf; - ret = odb_read_object_info_extended(odb, oid, &oi, - OBJECT_INFO_DIE_IF_CORRUPT); + ret = odb_read_object_info_extended(odb, oid, &oi, flags); if (ret) return ret;