From: Patrick Steinhardt Date: Wed, 28 Oct 2026 07:11:39 GMT Subject: [PATCH v3 1/6] odb/source-files: rename alternates-related functions Message-ID: <20261028-pks-odb-files-reload-alternates-v3-1-011ddb64b626@pks.im> In-Reply-To: <20261028-pks-odb-files-reload-alternates-v3-0-011ddb64b626@pks.im> The functions that prepare and add alternates in the "files" backend were originally part of the object database layer, which explains why they still have an "odb_" prefix. That prefix does not make much sense anymore now that those are part of the "files" backend. Drop the prefix. Signed-off-by: Patrick Steinhardt --- odb/source-files.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/odb/source-files.c b/odb/source-files.c index 5b4277fbfd3..d31da6e5d90 100644 --- a/odb/source-files.c +++ b/odb/source-files.c @@ -348,9 +348,9 @@ static int read_alternates(const char *object_dir, struct strvec *out) return 0; } -static void odb_add_alternate_recursively(struct odb_source_files *files, - const char *path, - int depth) +static void add_alternate_recursively(struct odb_source_files *files, + const char *path, + int depth) { struct odb_files_dir *alternate; struct strvec alternates = STRVEC_INIT; @@ -377,15 +377,15 @@ static void odb_add_alternate_recursively(struct odb_source_files *files, path); } else { for (size_t i = 0; i < alternates.nr; i++) - odb_add_alternate_recursively(files, alternates.v[i], depth + 1); + add_alternate_recursively(files, alternates.v[i], depth + 1); } out: strvec_clear(&alternates); } -static void odb_prepare_alternates(struct odb_source_files *files, - const char *alternate_db) +static void prepare_alternates(struct odb_source_files *files, + const char *alternate_db) { struct strvec alternates = STRVEC_INIT; @@ -393,7 +393,7 @@ static void odb_prepare_alternates(struct odb_source_files *files, read_alternates(files->dirs->abspath, &alternates); for (size_t i = 0; i < alternates.nr; i++) - odb_add_alternate_recursively(files, alternates.v[i], 0); + add_alternate_recursively(files, alternates.v[i], 0); strvec_clear(&alternates); } @@ -410,7 +410,7 @@ static void odb_source_files_prepare(struct odb_source *source, * for the lifetime of the process. */ if (flags & ODB_PREPARE_FLUSH_CACHES) - odb_prepare_alternates(files, NULL); + prepare_alternates(files, NULL); for (struct odb_files_dir *dir = files->dirs; dir; dir = dir->next) { odb_source_prepare(&dir->loose->base, flags); @@ -1299,7 +1299,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb, if (!is_absolute_path(object_dir)) chdir_notify_register(odb_source_files_reparent, files); - odb_prepare_alternates(files, alternates); + prepare_alternates(files, alternates); free(object_dir); free(alternates); -- 2.56.0.341.g393f52fd96.dirty