From cbd53a2193d11e83b5bad2c3514bd1603074bc36 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Tue, 15 May 2018 16:42:15 -0700 Subject: object-store: move object access functions to object-store.h This should make these functions easier to find and cache.h less overwhelming to read. In particular, this moves: - read_object_file - oid_object_info - write_object_file As a result, most of the codebase needs to #include object-store.h. In this patch the #include is only added to files that would fail to compile otherwise. It would be better to #include wherever identifiers from the header are used. That can happen later when we have better tooling for it. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- builtin/receive-pack.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin/receive-pack.c') diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index c4272fbc96..36906fd5e9 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -25,6 +25,7 @@ #include "tmp-objdir.h" #include "oidset.h" #include "packfile.h" +#include "object-store.h" #include "protocol.h" static const char * const receive_pack_usage[] = { -- cgit v1.2.3 From 19143f139d5a1a821d9d066da5d1c136a53ed803 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 17 May 2018 15:51:44 -0700 Subject: shallow: add repository argument to register_shallow Add a repository argument to allow callers of register_shallow to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- builtin/receive-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/receive-pack.c') diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 36906fd5e9..c666820b69 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -906,7 +906,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si) * not lose these new roots.. */ for (i = 0; i < extra.nr; i++) - register_shallow(&extra.oid[i]); + register_shallow(the_repository, &extra.oid[i]); si->shallow_ref[cmd->index] = 0; oid_array_clear(&extra); -- cgit v1.2.3