return NULL;
}
-void close_commit_graph(struct raw_object_store *o)
+void close_commit_graph(struct object_database *o)
{
if (!o->commit_graph)
return;
struct commit;
struct bloom_filter_settings;
struct repository;
-struct raw_object_store;
+struct object_database;
struct string_list;
char *get_commit_graph_filename(struct object_directory *odb);
int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags);
-void close_commit_graph(struct raw_object_store *);
+void close_commit_graph(struct object_database *);
void free_commit_graph(struct commit_graph *);
/*
} value;
};
-static const struct cached_object *find_cached_object(struct raw_object_store *object_store,
+static const struct cached_object *find_cached_object(struct object_database *object_store,
const struct object_id *oid)
{
static const struct cached_object empty_tree = {
/*
* Return non-zero iff the path is usable as an alternate object database.
*/
-static int alt_odb_usable(struct raw_object_store *o,
+static int alt_odb_usable(struct object_database *o,
struct strbuf *path,
const char *normalized_objdir, khiter_t *pos)
{
type_name(expect));
}
-struct raw_object_store *raw_object_store_new(void)
+struct object_database *odb_new(void)
{
- struct raw_object_store *o = xmalloc(sizeof(*o));
+ struct object_database *o = xmalloc(sizeof(*o));
memset(o, 0, sizeof(*o));
INIT_LIST_HEAD(&o->packed_git_mru);
return o;
}
-static void free_object_directories(struct raw_object_store *o)
+static void free_object_directories(struct object_database *o)
{
while (o->odb) {
struct object_directory *next;
o->odb_by_path = NULL;
}
-void raw_object_store_clear(struct raw_object_store *o)
+void odb_clear(struct object_database *o)
{
FREE_AND_NULL(o->alternate_db);
struct multi_pack_index;
struct cached_object_entry;
-struct raw_object_store {
+/*
+ * The object database encapsulates access to objects in a repository. It
+ * manages one or more backends that store the actual objects which are
+ * configured via alternates.
+ */
+struct object_database {
/*
* Set of all object directories; the main directory is first (and
* cannot be NULL after initialization). Subsequent directories are
unsigned packed_git_initialized : 1;
};
-struct raw_object_store *raw_object_store_new(void);
-void raw_object_store_clear(struct raw_object_store *o);
+struct object_database *odb_new(void);
+void odb_clear(struct object_database *o);
/*
* Create a temporary file rooted in the object database directory, or
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;
uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
-struct raw_object_store;
+struct object_database;
unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
void close_pack_windows(struct packed_git *);
void close_pack(struct packed_git *);
-void close_object_store(struct raw_object_store *o);
+void close_object_store(struct object_database *o);
void unuse_pack(struct pack_window **);
void clear_delta_base_cache(void);
struct packed_git *add_packed_git(struct repository *r, const char *path,
void initialize_repository(struct repository *repo)
{
- repo->objects = raw_object_store_new();
+ repo->objects = odb_new();
repo->remote_state = remote_state_new();
repo->parsed_objects = parsed_object_pool_new(repo);
ALLOC_ARRAY(repo->index, 1);
FREE_AND_NULL(repo->worktree);
FREE_AND_NULL(repo->submodule_prefix);
- raw_object_store_clear(repo->objects);
+ odb_clear(repo->objects);
FREE_AND_NULL(repo->objects);
parsed_object_pool_clear(repo->parsed_objects);
struct index_state;
struct lock_file;
struct pathspec;
-struct raw_object_store;
+struct object_database;
struct submodule_cache;
struct promisor_remote_config;
struct remote_state;
/*
* Holds any information related to accessing the raw object content.
*/
- struct raw_object_store *objects;
+ struct object_database *objects;
/*
* All objects in this repository that have been parsed. This structure