summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-30 07:09:04 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-30 07:09:04 (GMT)
commit264b16b621d9996006b73786b0ccdf8b80d29c49 (patch)
tree8434eb066fc67d29a8bbde1b7e5d2987d8b1b00f /sha1_file.c
parentcdda474525f67d6f7c8bb9ae8e4c6bada2c50afa (diff)
downloadgit-264b16b621d9996006b73786b0ccdf8b80d29c49.zip
git-264b16b621d9996006b73786b0ccdf8b80d29c49.tar.gz
git-264b16b621d9996006b73786b0ccdf8b80d29c49.tar.bz2
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>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sha1_file.c b/sha1_file.c
index fe374c6..1e847a8 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -871,7 +871,8 @@ void packed_object_info_detail(struct pack_entry *e,
strcpy(type, "tag");
break;
default:
- die("corrupted pack file");
+ die("corrupted pack file %s containing object of kind %d",
+ p->pack_name, kind);
}
*store_size = 0; /* notyet */
}
@@ -910,7 +911,8 @@ static int packed_object_info(struct pack_entry *entry,
strcpy(type, "tag");
break;
default:
- die("corrupted pack file");
+ die("corrupted pack file %s containing object of kind %d",
+ p->pack_name, kind);
}
if (sizep)
*sizep = size;
@@ -1010,7 +1012,7 @@ static void *unpack_entry(struct pack_entry *entry,
retval = unpack_entry_gently(entry, type, sizep);
unuse_packed_git(p);
if (!retval)
- die("corrupted pack file");
+ die("corrupted pack file %s", p->pack_name);
return retval;
}