refs: split off reading loose ref data in separate function

This prepares for handling FETCH_HEAD (which is not a regular ref)
separately from the ref backend.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Han-Wen Nienhuys
2020-08-19 14:27:55 +00:00
committed by Junio C Hamano
parent 878e727637
commit e39620f07e
2 changed files with 33 additions and 23 deletions

View File

@ -674,6 +674,12 @@ struct ref_store {
const struct ref_storage_be *be;
};
/*
* Parse contents of a loose ref file.
*/
int parse_loose_ref_contents(const char *buf, struct object_id *oid,
struct strbuf *referent, unsigned int *type);
/*
* Fill in the generic part of refs and add it to our collection of
* reference stores.