{"thread":{"id":"43783","subject":"[PATCH] clarify some error messages wrt unknown object types","startedAt":"2006-12-20T18:34:05Z","lastAt":"2006-12-20T18:34:05Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"298749","messageId":"Pine.LNX.4.64.0612201328160.18171@xanadu.home","threadId":"43783","inReplyTo":null,"subject":"[PATCH] clarify some error messages wrt unknown object types","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-12-20T18:34:05Z","receivedAt":"2006-12-20T18:34:05Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"If ever new object types are added for future extensions then better \nhave current git version report them as \"unknown\" instead of \n\"corrupted\".\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n\n---\n\ndiff --git a/index-pack.c b/index-pack.c\nindex 6d6c92b..35be3e9 100644\n--- a/index-pack.c\n+++ b/index-pack.c\n@@ -268,7 +268,7 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_\n \tcase OBJ_TAG:\n \t\tbreak;\n \tdefault:\n-\t\tbad_object(obj->offset, \"bad object type %d\", obj->type);\n+\t\tbad_object(obj->offset, \"unknown object type %d\", obj->type);\n \t}\n \tobj->hdr_size = consumed_bytes - obj->offset;\n \ndiff --git a/sha1_file.c b/sha1_file.c\nindex 63f416b..1c4df5b 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -1013,7 +1013,7 @@ void packed_object_info_detail(struct packed_git *p,\n \tfor (;;) {\n \t\tswitch (kind) {\n \t\tdefault:\n-\t\t\tdie(\"corrupted pack file %s containing object of kind %d\",\n+\t\t\tdie(\"pack %s contains unknown object type %d\",\n \t\t\t    p->pack_name, kind);\n \t\tcase OBJ_COMMIT:\n \t\tcase OBJ_TREE:\n@@ -1063,7 +1063,7 @@ static int packed_object_info(struct packed_git *p, unsigned long offset,\n \t\tstrcpy(type, type_names[kind]);\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"corrupted pack file %s containing object of kind %d\",\n+\t\tdie(\"pack %s contains unknown object type %d\",\n \t\t    p->pack_name, kind);\n \t}\n"}]}