From 5508f69348ee1073666d3611a4a62ecdb0849e4e Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Fri, 23 Mar 2018 18:21:01 +0100 Subject: pack: move prepare_packed_git_run_once to object store MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each repository's object store can be initialized independently, so they must not share a run_once variable. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- packfile.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'packfile.c') diff --git a/packfile.c b/packfile.c index 8b27b69bff..98162a0513 100644 --- a/packfile.c +++ b/packfile.c @@ -884,12 +884,11 @@ static void prepare_packed_git_mru(void) list_add_tail(&p->mru, &the_repository->objects->packed_git_mru); } -static int prepare_packed_git_run_once = 0; void prepare_packed_git(void) { struct alternate_object_database *alt; - if (prepare_packed_git_run_once) + if (the_repository->objects->packed_git_initialized) return; prepare_packed_git_one(get_object_directory(), 1); prepare_alt_odb(); @@ -897,13 +896,13 @@ void prepare_packed_git(void) prepare_packed_git_one(alt->path, 0); rearrange_packed_git(); prepare_packed_git_mru(); - prepare_packed_git_run_once = 1; + the_repository->objects->packed_git_initialized = 1; } void reprepare_packed_git(void) { approximate_object_count_valid = 0; - prepare_packed_git_run_once = 0; + the_repository->objects->packed_git_initialized = 0; prepare_packed_git(); } -- cgit v1.3