| 2060 | } |
| 2061 | |
| 2062 | static int refs_read_special_head(struct ref_store *ref_store, |
| 2063 | const char *refname, struct object_id *oid, |
| 2064 | struct strbuf *referent, unsigned int *type, |
| 2065 | int *failure_errno) |
| 2066 | { |
| 2067 | struct strbuf full_path = STRBUF_INIT; |
| 2068 | struct strbuf content = STRBUF_INIT; |
| 2069 | int result = -1; |
| 2070 | strbuf_addf(&full_path, "%s/%s", ref_store->gitdir, refname); |
| 2071 | |
| 2072 | if (strbuf_read_file(&content, full_path.buf, 0) < 0) { |
| 2073 | *failure_errno = errno; |
| 2074 | goto done; |
| 2075 | } |
| 2076 | |
| 2077 | result = parse_loose_ref_contents(ref_store->repo->hash_algo, content.buf, |
| 2078 | oid, referent, type, NULL, failure_errno); |
| 2079 | |
| 2080 | done: |
| 2081 | strbuf_release(&full_path); |
| 2082 | strbuf_release(&content); |
| 2083 | return result; |
| 2084 | } |
| 2085 | |
| 2086 | int refs_read_raw_ref(struct ref_store *ref_store, const char *refname, |
| 2087 | struct object_id *oid, struct strbuf *referent, |
no test coverage detected