| 814 | } |
| 815 | |
| 816 | static int packed_read_raw_ref(struct ref_store *ref_store, const char *refname, |
| 817 | struct object_id *oid, struct strbuf *referent UNUSED, |
| 818 | unsigned int *type, int *failure_errno) |
| 819 | { |
| 820 | struct packed_ref_store *refs = |
| 821 | packed_downcast(ref_store, REF_STORE_READ, "read_raw_ref"); |
| 822 | struct snapshot *snapshot = get_snapshot(refs); |
| 823 | const char *rec; |
| 824 | |
| 825 | *type = 0; |
| 826 | |
| 827 | rec = find_reference_location(snapshot, refname, 1); |
| 828 | |
| 829 | if (!rec) { |
| 830 | /* refname is not a packed reference. */ |
| 831 | *failure_errno = ENOENT; |
| 832 | return -1; |
| 833 | } |
| 834 | |
| 835 | if (get_oid_hex_algop(rec, oid, ref_store->repo->hash_algo)) |
| 836 | die_invalid_line(refs->path, rec, snapshot->eof - rec); |
| 837 | |
| 838 | *type = REF_ISPACKED; |
| 839 | return 0; |
| 840 | } |
| 841 | |
| 842 | /* |
| 843 | * This value is set in `base.flags` if the peeled value of the |
nothing calls this directly
no test coverage detected