| 209 | } |
| 210 | |
| 211 | enum peel_status peel_object_ext(struct repository *r, |
| 212 | const struct object_id *name, |
| 213 | struct object_id *oid, |
| 214 | unsigned flags, |
| 215 | enum object_type *typep) |
| 216 | { |
| 217 | struct object *o = lookup_unknown_object(r, name); |
| 218 | |
| 219 | if (o->type == OBJ_NONE) { |
| 220 | int type = odb_read_object_info(r->objects, name, NULL); |
| 221 | if (type < 0 || !object_as_type(o, type, 0)) |
| 222 | return PEEL_INVALID; |
| 223 | } |
| 224 | |
| 225 | if (o->type != OBJ_TAG) { |
| 226 | *typep = o->type; |
| 227 | return PEEL_NON_TAG; |
| 228 | } |
| 229 | |
| 230 | while (o && o->type == OBJ_TAG) { |
| 231 | o = parse_object(r, &o->oid); |
| 232 | if (o && o->type == OBJ_TAG && ((struct tag *)o)->tagged) { |
| 233 | o = ((struct tag *)o)->tagged; |
| 234 | |
| 235 | if (flags & PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE) { |
| 236 | int type = odb_read_object_info(r->objects, &o->oid, NULL); |
| 237 | if (type < 0 || !object_as_type(o, type, 0)) |
| 238 | return PEEL_INVALID; |
| 239 | } |
| 240 | } else { |
| 241 | o = NULL; |
| 242 | } |
| 243 | } |
| 244 | if (!o) |
| 245 | return PEEL_INVALID; |
| 246 | |
| 247 | oidcpy(oid, &o->oid); |
| 248 | *typep = o->type; |
| 249 | return PEEL_PEELED; |
| 250 | } |
| 251 | |
| 252 | enum peel_status peel_object(struct repository *r, |
| 253 | const struct object_id *name, |
no test coverage detected