Merge branch 'ps/object-store'

Code clean-up around object access API.

* ps/object-store:
  odb: rename `read_object_with_reference()`
  odb: rename `pretend_object_file()`
  odb: rename `has_object()`
  odb: rename `repo_read_object_file()`
  odb: rename `oid_object_info()`
  odb: trivial refactorings to get rid of `the_repository`
  odb: get rid of `the_repository` when handling submodule sources
  odb: get rid of `the_repository` when handling the primary source
  odb: get rid of `the_repository` in `for_each()` functions
  odb: get rid of `the_repository` when handling alternates
  odb: get rid of `the_repository` in `odb_mkstemp()`
  odb: get rid of `the_repository` in `assert_oid_type()`
  odb: get rid of `the_repository` in `find_odb()`
  odb: introduce parent pointers
  object-store: rename files to "odb.{c,h}"
  object-store: rename `object_directory` to `odb_source`
  object-store: rename `raw_object_store` to `object_database`
This commit is contained in:
Junio C Hamano
2025-07-15 15:18:17 -07:00
140 changed files with 1453 additions and 1297 deletions

View File

@@ -13,7 +13,7 @@
#include "submodule.h"
#include "strbuf.h"
#include "object-name.h"
#include "object-store.h"
#include "odb.h"
#include "parse-options.h"
#include "thread-utils.h"
#include "tree-walk.h"
@@ -731,8 +731,8 @@ static const struct submodule *config_from(struct submodule_cache *cache,
if (submodule)
goto out;
config = repo_read_object_file(the_repository, &oid, &type,
&config_size);
config = odb_read_object(the_repository->objects, &oid,
&type, &config_size);
if (!config || type != OBJ_BLOB)
goto out;
@@ -798,7 +798,8 @@ static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void
repo_get_oid(repo, GITMODULES_HEAD, &oid) >= 0) {
config_source.blob = oidstr = xstrdup(oid_to_hex(&oid));
if (repo != the_repository)
add_submodule_odb_by_path(repo->objects->odb->path);
odb_add_submodule_source_by_path(the_repository->objects,
repo->objects->sources->path);
} else {
goto out;
}