@matheusbsbs / matheus-bagliano / commits / 08a19d873c
Fork 0

clarify some error messages wrt unknown object types

If ever new object types are added for future extensions then better have current git version report them as "unknown" instead of "corrupted". Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Nicolas Pitre committed Dec 20, 2006 at 13:34 UTC 08a19d873c16aa6127bf4c40cf99a9dd19558a0c
2 files changed +3 -3
index-pack.c
+1 -1
@@ -266,7 +266,7 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_
266 case OBJ_TAG:
267 break;
268 default:
269 - bad_object(obj->offset, "bad object type %d", obj->type);
269 + bad_object(obj->offset, "unknown object type %d", obj->type);
270 }
271 obj->hdr_size = consumed_bytes - obj->offset;
272
sha1_file.c
+2 -2
@@ -1013,7 +1013,7 @@ void packed_object_info_detail(struct packed_git *p,
1013 for (;;) {
1014 switch (kind) {
1015 default:
1016 - die("corrupted pack file %s containing object of kind %d",
1016 + die("pack %s contains unknown object type %d",
1017 p->pack_name, kind);
1018 case OBJ_COMMIT:
1019 case OBJ_TREE:
@@ -1063,7 +1063,7 @@ static int packed_object_info(struct packed_git *p, unsigned long offset,
1063 strcpy(type, type_names[kind]);
1064 break;
1065 default:
1066 - die("corrupted pack file %s containing object of kind %d",
1066 + die("pack %s contains unknown object type %d",
1067 p->pack_name, kind);
1068 }
1069 if (sizep)