Skip to content

Commit ae77afc

Browse files
pks-tgitster
authored andcommitted
odb: drop gaps in object info flag values
The object info flag values have a two gaps in their definitions, where some bits are skipped over. These gaps don't really hurt, but it makes one wonder whether anything is going on and whether a subset of flags might be defined somewhere else. That's not the case though. Instead, this is a case of flags that have been dropped in the past: - The value 4 was used by `OBJECT_INFO_SKIP_CACHED`, removed in 9c8a294 (sha1-file: remove OBJECT_INFO_SKIP_CACHED, 2020-01-02). - The value 8 was used by `OBJECT_INFO_ALLOW_UNKNOWN_TYPE`, removed in ae24b03 (object-file: drop OBJECT_INFO_ALLOW_UNKNOWN_TYPE flag, 2025-05-16). Close those gaps to avoid any more confusion. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6cf965c commit ae77afc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

odb.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,22 +353,22 @@ struct object_info {
353353
#define OBJECT_INFO_INIT { 0 }
354354

355355
/* Invoke lookup_replace_object() on the given hash */
356-
#define OBJECT_INFO_LOOKUP_REPLACE 1
356+
#define OBJECT_INFO_LOOKUP_REPLACE (1 << 0)
357357
/* Do not retry packed storage after checking packed and loose storage */
358-
#define OBJECT_INFO_QUICK 8
358+
#define OBJECT_INFO_QUICK (1 << 1)
359359
/*
360360
* Do not attempt to fetch the object if missing (even if fetch_is_missing is
361361
* nonzero).
362362
*/
363-
#define OBJECT_INFO_SKIP_FETCH_OBJECT 16
363+
#define OBJECT_INFO_SKIP_FETCH_OBJECT (1 << 2)
364364
/*
365365
* This is meant for bulk prefetching of missing blobs in a partial
366366
* clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
367367
*/
368368
#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
369369

370370
/* Die if object corruption (not just an object being missing) was detected. */
371-
#define OBJECT_INFO_DIE_IF_CORRUPT 32
371+
#define OBJECT_INFO_DIE_IF_CORRUPT (1 << 3)
372372

373373
/*
374374
* Read object info from the object database and populate the `object_info`

0 commit comments

Comments
 (0)