@@ -382,23 +382,29 @@ struct object_info {
382382 */
383383#define OBJECT_INFO_INIT { 0 }
384384
385- /* Invoke lookup_replace_object() on the given hash */
386- #define OBJECT_INFO_LOOKUP_REPLACE 1
387- /* Do not retry packed storage after checking packed and loose storage */
388- #define OBJECT_INFO_QUICK 8
389- /*
390- * Do not attempt to fetch the object if missing (even if fetch_is_missing is
391- * nonzero).
392- */
393- #define OBJECT_INFO_SKIP_FETCH_OBJECT 16
394- /*
395- * This is meant for bulk prefetching of missing blobs in a partial
396- * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
397- */
398- #define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
385+ /* Flags that can be passed to `odb_read_object_info_extended()`. */
386+ enum object_info_flags {
387+ /* Invoke lookup_replace_object() on the given hash. */
388+ OBJECT_INFO_LOOKUP_REPLACE = (1 << 0 ),
399389
400- /* Die if object corruption (not just an object being missing) was detected. */
401- #define OBJECT_INFO_DIE_IF_CORRUPT 32
390+ /* Do not reprepare object sources when the first lookup has failed. */
391+ OBJECT_INFO_QUICK = (1 << 1 ),
392+
393+ /*
394+ * Do not attempt to fetch the object if missing (even if fetch_is_missing is
395+ * nonzero).
396+ */
397+ OBJECT_INFO_SKIP_FETCH_OBJECT = (1 << 2 ),
398+
399+ /* Die if object corruption (not just an object being missing) was detected. */
400+ OBJECT_INFO_DIE_IF_CORRUPT = (1 << 3 ),
401+
402+ /*
403+ * This is meant for bulk prefetching of missing blobs in a partial
404+ * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK.
405+ */
406+ OBJECT_INFO_FOR_PREFETCH = (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK ),
407+ };
402408
403409/*
404410 * Read object info from the object database and populate the `object_info`
@@ -407,7 +413,7 @@ struct object_info {
407413int odb_read_object_info_extended (struct object_database * odb ,
408414 const struct object_id * oid ,
409415 struct object_info * oi ,
410- unsigned flags );
416+ enum object_info_flags flags );
411417
412418/*
413419 * Read a subset of object info for the given object ID. Returns an `enum
@@ -419,7 +425,7 @@ int odb_read_object_info(struct object_database *odb,
419425 const struct object_id * oid ,
420426 unsigned long * sizep );
421427
422- enum {
428+ enum has_object_flags {
423429 /* Retry packed storage after checking packed and loose storage */
424430 HAS_OBJECT_RECHECK_PACKED = (1 << 0 ),
425431 /* Allow fetching the object in case the repository has a promisor remote. */
@@ -432,7 +438,7 @@ enum {
432438 */
433439int odb_has_object (struct object_database * odb ,
434440 const struct object_id * oid ,
435- unsigned flags );
441+ enum has_object_flags flags );
436442
437443int odb_freshen_object (struct object_database * odb ,
438444 const struct object_id * oid );
0 commit comments