Taylor Blau <me@xxxxxxxxxxxx> writes: > I think we need some sort of guard here, since we could receive any > value of object_type, but you're right that this isn't the right one. It > should probably be something like: > > if (type < OBJ_COMMIT || type > OBJ_TAG) > > to pick out the sentinel values like OBJ_BAD and OBJ_NONE, as well as > the pack-specific types, like OBJ_OFS_DELTA and so on. Yeah, it looked strange to start checking for OBJ_BLOB and OBJ_TREE in commits that starts passing these types to the function, while the code in the function was prepared to take any valid type, so using the above condition from the get-go would probably be a lot more sensible.