Skip to content

Commit

Permalink
clarify some error messages wrt unknown object types
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Dec 20, 2006
1 parent 8502357 commit 08a19d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 08a19d8

Please sign in to comment.