if (current_ref && (current_ref->name == refname
|| !strcmp(current_ref->name, refname))) {
if (current_ref->flag & REF_KNOWS_PEELED) {
+ if (is_null_sha1(current_ref->u.value.peeled))
+ return -1;
hashcpy(sha1, current_ref->u.value.peeled);
return 0;
}
}
fallback:
- o = parse_object(base);
- if (o && o->type == OBJ_TAG) {
+ o = lookup_unknown_object(base);
+ if (o->type == OBJ_NONE) {
+ int type = sha1_object_info(base, NULL);
+ if (type < 0)
+ return -1;
+ o->type = type;
+ }
+
+ if (o->type == OBJ_TAG) {
o = deref_tag_noverify(o);
if (o) {
hashcpy(sha1, o->sha1);