352
*/
353
#define OBJECT_INFO_INIT { 0 }
354
355
-/* Invoke lookup_replace_object() on the given hash */
356
-#define OBJECT_INFO_LOOKUP_REPLACE (1 << 0)
357
-/* Do not retry packed storage after checking packed and loose storage */
358
-#define OBJECT_INFO_QUICK (1 << 1)
359
-/*
360
- * Do not attempt to fetch the object if missing (even if fetch_is_missing is
361
- * nonzero).
362
- */
363
-#define OBJECT_INFO_SKIP_FETCH_OBJECT (1 << 2)
364
-/*
365
- * This is meant for bulk prefetching of missing blobs in a partial
366
- * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
367
- */
368
-#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
355
+/* Flags that can be passed to `odb_read_object_info_extended()`. */
356
+enum object_info_flags {
357
+ /* Invoke lookup_replace_object() on the given hash. */
358
+ OBJECT_INFO_LOOKUP_REPLACE = (1 << 0),
359
+
360
+ /* Do not reprepare object sources when the first lookup has failed. */
361
+ OBJECT_INFO_QUICK = (1 << 1),
362
+
363
+ /*
364
+ * Do not attempt to fetch the object if missing (even if fetch_is_missing is
365
+ * nonzero).
366
+ */
367
+ OBJECT_INFO_SKIP_FETCH_OBJECT = (1 << 2),
368
+
369
+ /* Die if object corruption (not just an object being missing) was detected. */
370
+ OBJECT_INFO_DIE_IF_CORRUPT = (1 << 3),
371
370
-/* Die if object corruption (not just an object being missing) was detected. */
371
-#define OBJECT_INFO_DIE_IF_CORRUPT (1 << 3)
372
+ /*
373
+ * This is meant for bulk prefetching of missing blobs in a partial
374
+ * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK.
375
+ */
376
+ OBJECT_INFO_FOR_PREFETCH = (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK),
377
+};
378
379
/*
380
* Read object info from the object database and populate the `object_info`
383
int odb_read_object_info_extended(struct object_database *odb,
384
const struct object_id *oid,
385
struct object_info *oi,
380
- unsigned flags);
386
+ enum object_info_flags flags);
387
388
/*
389
* Read a subset of object info for the given object ID. Returns an `enum