aboutsummaryrefslogtreecommitdiffstats
path: root/packfile.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-09 08:29:08 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-09 08:29:08 -0700
commitdb0583b3fd18596b8e360b0fd1554ac3e5c15793 (patch)
tree8c862bb8c3ffabeeb92ed88ecd3dd182dbd95f73 /packfile.c
parenta30f80fde927d70950b3b4d1820813480968fb0d (diff)
parent841a03b4046ab81276743b4d7e727b1658f805da (diff)
downloadgit-db0583b3fd18596b8e360b0fd1554ac3e5c15793.tar.gz
Merge branch 'ps/object-store' into ps/object-store-midx
* 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`
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/packfile.c b/packfile.c
index 70c7208f02..af9ccfdba6 100644
--- a/packfile.c
+++ b/packfile.c
@@ -19,7 +19,7 @@
#include "tree-walk.h"
#include "tree.h"
#include "object-file.h"
-#include "object-store.h"
+#include "odb.h"
#include "midx.h"
#include "commit-graph.h"
#include "pack-revindex.h"
@@ -359,7 +359,7 @@ void close_pack(struct packed_git *p)
oidset_clear(&p->bad_objects);
}
-void close_object_store(struct raw_object_store *o)
+void close_object_store(struct object_database *o)
{
struct packed_git *p;
@@ -1029,16 +1029,16 @@ static void prepare_packed_git_mru(struct repository *r)
static void prepare_packed_git(struct repository *r)
{
- struct object_directory *odb;
+ struct odb_source *source;
if (r->objects->packed_git_initialized)
return;
- prepare_alt_odb(r);
- for (odb = r->objects->odb; odb; odb = odb->next) {
- int local = (odb == r->objects->odb);
- prepare_multi_pack_index_one(r, odb->path, local);
- prepare_packed_git_one(r, odb->path, local);
+ odb_prepare_alternates(r->objects);
+ for (source = r->objects->sources; source; source = source->next) {
+ int local = (source == r->objects->sources);
+ prepare_multi_pack_index_one(r, source->path, local);
+ prepare_packed_git_one(r, source->path, local);
}
rearrange_packed_git(r);
@@ -1048,7 +1048,7 @@ static void prepare_packed_git(struct repository *r)
void reprepare_packed_git(struct repository *r)
{
- struct object_directory *odb;
+ struct odb_source *source;
obj_read_lock();
@@ -1059,10 +1059,10 @@ void reprepare_packed_git(struct repository *r)
* the lifetime of the process.
*/
r->objects->loaded_alternates = 0;
- prepare_alt_odb(r);
+ odb_prepare_alternates(r->objects);
- for (odb = r->objects->odb; odb; odb = odb->next)
- odb_clear_loose_cache(odb);
+ for (source = r->objects->sources; source; source = source->next)
+ odb_clear_loose_cache(source);
r->objects->approximate_object_count_valid = 0;
r->objects->packed_git_initialized = 0;
@@ -1321,7 +1321,7 @@ static int retry_bad_packed_offset(struct repository *r,
return OBJ_BAD;
nth_packed_object_id(&oid, p, pack_pos_to_index(p, pos));
mark_bad_packed_object(p, &oid);
- type = oid_object_info(r, &oid, NULL);
+ type = odb_read_object_info(r->objects, &oid, NULL);
if (type <= OBJ_NONE)
return OBJ_BAD;
return type;
@@ -1849,7 +1849,8 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
oi.typep = &type;
oi.sizep = &base_size;
oi.contentp = &base;
- if (oid_object_info_extended(r, &base_oid, &oi, 0) < 0)
+ if (odb_read_object_info_extended(r->objects, &base_oid,
+ &oi, 0) < 0)
base = NULL;
external_base = base;