提交 6e1c6c10 编写于 作者: J Junio C Hamano

Make sure we barf on ref^{type} failure.

Martin Langhoff noticed that ref^0 barfed correctly when we did not
have the commit in a broken repository, but ref^{commit} didn't.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 f1f0a2be
......@@ -323,6 +323,8 @@ static int peel_onion(const char *name, int len, unsigned char *sha1)
return -1;
if (!type_string) {
o = deref_tag(o);
if (!o || (!o->parsed && !parse_object(o->sha1)))
return -1;
memcpy(sha1, o->sha1, 20);
}
else {
......@@ -332,7 +334,7 @@ static int peel_onion(const char *name, int len, unsigned char *sha1)
*/
while (1) {
if (!o)
if (!o || (!o->parsed && !parse_object(o->sha1)))
return -1;
if (o->type == type_string) {
memcpy(sha1, o->sha1, 20);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册