* Return true if refname, which has the specified oid and flags, can * be resolved to an object in the database. If the referred-to object * does not exist, emit a warning and return false. */
| 419 | * does not exist, emit a warning and return false. |
| 420 | */ |
| 421 | int ref_resolves_to_object(const char *refname, |
| 422 | struct repository *repo, |
| 423 | const struct object_id *oid, |
| 424 | unsigned int flags) |
| 425 | { |
| 426 | if (flags & REF_ISBROKEN) |
| 427 | return 0; |
| 428 | if (!odb_has_object(repo->objects, oid, |
| 429 | ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) { |
| 430 | error(_("%s does not point to a valid object!"), refname); |
| 431 | return 0; |
| 432 | } |
| 433 | return 1; |
| 434 | } |
| 435 | |
| 436 | char *refs_resolve_refdup(struct ref_store *refs, |
| 437 | const char *refname, int resolve_flags, |
no test coverage detected