From 709dfa69908c9448db91a9bcc96941549be6421e Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 1 Jul 2019 09:17:40 -0400 Subject: object-store.h: move for_each_alternate_ref() from transport.h There's nothing inherently transport-related about enumerating the alternate ref tips. The code has lived in transport.[ch] because the only use so far had been advertising available tips during transport. But it could be used for more, and a future patch will teach rev-list to access these refs. Let's move it alongside the other alt-odb code, declaring it in object-store.h with the implementation in sha1-file.c. This lets us drop the inclusion of transport.h from receive-pack, which perhaps shows how it was misplaced (though receive-pack is about transporting objects, transport.h is mostly about the client side). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- object-store.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'object-store.h') diff --git a/object-store.h b/object-store.h index 272e01e452..74d6860a9f 100644 --- a/object-store.h +++ b/object-store.h @@ -33,6 +33,8 @@ void prepare_alt_odb(struct repository *r); char *compute_alternate_path(const char *path, struct strbuf *err); typedef int alt_odb_fn(struct object_directory *, void *); int foreach_alt_odb(alt_odb_fn, void*); +typedef void alternate_ref_fn(const struct object_id *oid, void *); +void for_each_alternate_ref(alternate_ref_fn, void *); /* * Add the directory to the on-disk alternates file; the new entry will also -- cgit v1.3-5-g9baa