提交 264b16b6 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <junkio@cox.net>
上级 cdda4745
...@@ -871,7 +871,8 @@ void packed_object_info_detail(struct pack_entry *e, ...@@ -871,7 +871,8 @@ void packed_object_info_detail(struct pack_entry *e,
strcpy(type, "tag"); strcpy(type, "tag");
break; break;
default: default:
die("corrupted pack file"); die("corrupted pack file %s containing object of kind %d",
p->pack_name, kind);
} }
*store_size = 0; /* notyet */ *store_size = 0; /* notyet */
} }
...@@ -910,7 +911,8 @@ static int packed_object_info(struct pack_entry *entry, ...@@ -910,7 +911,8 @@ static int packed_object_info(struct pack_entry *entry,
strcpy(type, "tag"); strcpy(type, "tag");
break; break;
default: default:
die("corrupted pack file"); die("corrupted pack file %s containing object of kind %d",
p->pack_name, kind);
} }
if (sizep) if (sizep)
*sizep = size; *sizep = size;
...@@ -1010,7 +1012,7 @@ static void *unpack_entry(struct pack_entry *entry, ...@@ -1010,7 +1012,7 @@ static void *unpack_entry(struct pack_entry *entry,
retval = unpack_entry_gently(entry, type, sizep); retval = unpack_entry_gently(entry, type, sizep);
unuse_packed_git(p); unuse_packed_git(p);
if (!retval) if (!retval)
die("corrupted pack file"); die("corrupted pack file %s", p->pack_name);
return retval; return retval;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册