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

@@ -14,7 +14,7 @@
#include "refs.h"
#include "refspec.h"
#include "object-file.h"
#include "object-store.h"
#include "odb.h"
#include "commit.h"
#include "object.h"
#include "tag.h"
@@ -323,7 +323,7 @@ static void export_blob(const struct object_id *oid)
object = (struct object *)lookup_blob(the_repository, oid);
eaten = 0;
} else {
buf = repo_read_object_file(the_repository, oid, &type, &size);
buf = odb_read_object(the_repository->objects, oid, &type, &size);
if (!buf)
die("could not read blob %s", oid_to_hex(oid));
if (check_object_signature(the_repository, oid, buf, size,
@@ -869,8 +869,8 @@ static void handle_tag(const char *name, struct tag *tag)
return;
}
buf = repo_read_object_file(the_repository, &tag->object.oid, &type,
&size);
buf = odb_read_object(the_repository->objects, &tag->object.oid,
&type, &size);
if (!buf)
die("could not read tag %s", oid_to_hex(&tag->object.oid));
message = memmem(buf, size, "\n\n", 2);
@@ -1200,7 +1200,7 @@ static void import_marks(char *input_file, int check_exists)
if (last_idnum < mark)
last_idnum = mark;
type = oid_object_info(the_repository, &oid, NULL);
type = odb_read_object_info(the_repository->objects, &oid, NULL);
if (type < 0)
die("object not found: %s", oid_to_hex(&oid));