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 --- rerere.c | 1 + 1 file changed, 1 insertion(+) (limited to 'rerere.c') diff --git a/rerere.c b/rerere.c index 18cae2d11c..fcb99cc954 100644 --- a/rerere.c +++ b/rerere.c @@ -9,6 +9,7 @@ #include "ll-merge.h" #include "attr.h" #include "pathspec.h" +#include "object-store.h" #include "sha1-lookup.h" #define RESOLVED 0 -- cgit v1.2.1 From 102de880d24fe66a8916e7c984e5bf8db6be047c Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 17 May 2018 15:51:51 -0700 Subject: path.c: migrate global git_path_* to take a repository argument Migrate all git_path_* functions that are defined in path.c to take a repository argument. Unlike other patches in this series, do not use the #define trick, as we rewrite the whole function, which is rather small. This doesn't migrate all the functions, as other builtins have their own local path functions defined using GIT_PATH_FUNC. So keep that macro around to serve the other locations. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- rerere.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rerere.c') diff --git a/rerere.c b/rerere.c index fcb99cc954..a3af88939a 100644 --- a/rerere.c +++ b/rerere.c @@ -201,7 +201,7 @@ static struct rerere_id *new_rerere_id(unsigned char *sha1) static void read_rr(struct string_list *rr) { struct strbuf buf = STRBUF_INIT; - FILE *in = fopen_or_warn(git_path_merge_rr(), "r"); + FILE *in = fopen_or_warn(git_path_merge_rr(the_repository), "r"); if (!in) return; @@ -897,7 +897,8 @@ int setup_rerere(struct string_list *merge_rr, int flags) if (flags & RERERE_READONLY) fd = 0; else - fd = hold_lock_file_for_update(&write_lock, git_path_merge_rr(), + fd = hold_lock_file_for_update(&write_lock, + git_path_merge_rr(the_repository), LOCK_DIE_ON_ERROR); read_rr(merge_rr); return fd; @@ -1247,6 +1248,6 @@ void rerere_clear(struct string_list *merge_rr) rmdir(rerere_path(id, NULL)); } } - unlink_or_warn(git_path_merge_rr()); + unlink_or_warn(git_path_merge_rr(the_repository)); rollback_lock_file(&write_lock); } -- cgit v1.2.1