Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 pack-write.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pack-write.c b/pack-write.c
index 88e4788..36b88a3 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -325,8 +325,17 @@ int encode_in_pack_object_header(enum object_type type, 
uintmax_t size, unsigned
        int n = 1;
        unsigned char c;
 
-       if (type < OBJ_COMMIT || type > OBJ_REF_DELTA)
+       switch (type) {
+       case OBJ_COMMIT:
+       case OBJ_TREE:
+       case OBJ_BLOB:
+       case OBJ_TAG:
+       case OBJ_OFS_DELTA:
+       case OBJ_REF_DELTA:
+               break;
+       default:
                die("bad type %d", type);
+       }
 
        c = (type << 4) | (size & 15);
        size >>= 4;
-- 
1.8.2.83.gc99314b

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to