Code

clarify some error messages wrt unknown object types
authorNicolas Pitre <nico@cam.org>
Wed, 20 Dec 2006 18:34:05 +0000 (13:34 -0500)
committerJunio C Hamano <junkio@cox.net>
Wed, 20 Dec 2006 18:46:34 +0000 (10:46 -0800)
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>
index-pack.c
sha1_file.c

index 43e007f8238006313e95b7d386a590ce51144dfa..5f6d128a836f8ed9447f81280ae679e19c9939ff 100644 (file)
@@ -266,7 +266,7 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_
        case OBJ_TAG:
                break;
        default:
-               bad_object(obj->offset, "bad object type %d", obj->type);
+               bad_object(obj->offset, "unknown object type %d", obj->type);
        }
        obj->hdr_size = consumed_bytes - obj->offset;
 
index 63f416bb5a900210d6b3ab15bb4ffe1e16244b9a..1c4df5b73e9dff900c69c0994eb21105614511b6 100644 (file)
@@ -1013,7 +1013,7 @@ void packed_object_info_detail(struct packed_git *p,
        for (;;) {
                switch (kind) {
                default:
-                       die("corrupted pack file %s containing object of kind %d",
+                       die("pack %s contains unknown object type %d",
                            p->pack_name, kind);
                case OBJ_COMMIT:
                case OBJ_TREE:
@@ -1063,7 +1063,7 @@ static int packed_object_info(struct packed_git *p, unsigned long offset,
                strcpy(type, type_names[kind]);
                break;
        default:
-               die("corrupted pack file %s containing object of kind %d",
+               die("pack %s contains unknown object type %d",
                    p->pack_name, kind);
        }
        if (sizep)