Tell which packfile is corrupt when we die.
The core part detected and died upon seeing a corrupted packfile, but did not help the user by telling which packfile is corrupt and how. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Sep 30, 2005 at 00:09 UTC
264b16b621d9996006b73786b0ccdf8b80d29c49
1 file changed
+5
-3
sha1_file.c
+5
-3
@@ -871,7 +871,8 @@ void packed_object_info_detail(struct pack_entry *e,
871
strcpy(type, "tag");
872
break;
873
default:
874
- die("corrupted pack file");
874
+ die("corrupted pack file %s containing object of kind %d",
875
+ p->pack_name, kind);
876
}
877
*store_size = 0; /* notyet */
878
}
@@ -910,7 +911,8 @@ static int packed_object_info(struct pack_entry *entry,
911
strcpy(type, "tag");
912
break;
913
default:
913
- die("corrupted pack file");
914
+ die("corrupted pack file %s containing object of kind %d",
915
+ p->pack_name, kind);
916
}
917
if (sizep)
918
*sizep = size;
@@ -1010,7 +1012,7 @@ static void *unpack_entry(struct pack_entry *entry,
1012
retval = unpack_entry_gently(entry, type, sizep);
1013
unuse_packed_git(p);
1014
if (!retval)
1013
- die("corrupted pack file");
1015
+ die("corrupted pack file %s", p->pack_name);
1016
return retval;
1017
}
1018