X-Git-Url: https://git.uis.cam.ac.uk/x/uis/git/git.git/blobdiff_plain/5af01caa08700e389d49a81be15c7413abd4aa69..8ff226a9d5ee065fe52752e6032f63cb6e4beccb:/refs.c diff --git a/refs.c b/refs.c index dc457742ea..7343565354 100644 --- a/refs.c +++ b/refs.c @@ -1531,9 +1531,8 @@ static enum peel_status peel_object(const unsigned char *name, unsigned char *sh if (o->type == OBJ_NONE) { int type = sha1_object_info(name, NULL); - if (type < 0) + if (type < 0 || !object_as_type(o, type, 0)) return PEEL_INVALID; - o->type = type; } if (o->type != OBJ_TAG)