aboutsummaryrefslogtreecommitdiffstats
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-11-03 08:41:58 +0100
committerJunio C Hamano <gitster@pobox.com>2025-11-03 12:18:46 -0800
commitc2da110411919387fef0f869181fb510d06295d8 (patch)
tree31749e83b17c22aa91e927276f34e92b30b54430 /odb.c
parent0820a4b120f310d87ac8817ade63896a901c9267 (diff)
downloadgit-c2da110411919387fef0f869181fb510d06295d8.tar.gz
odb: adjust naming to free object sources
The functions `free_object_directory()` and `free_object_directories()` are responsible for freeing a single object source or all object sources connected to an object database, respectively. The associated structure has been renamed from `struct object_directory` to `struct odb_source` in a1e2581a1e (object-store: rename `object_directory` to `odb_source`, 2025-07-01) though, so the names are somewhat stale nowadays. Rename them to mention the new struct name instead. Furthermore, while at it, adapt them to our modern naming schema where we first have the subject followed by a verb. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb.c')
-rw-r--r--odb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/odb.c b/odb.c
index d2d4c514ae..77490d7fdb 100644
--- a/odb.c
+++ b/odb.c
@@ -365,7 +365,7 @@ struct odb_source *odb_set_temporary_primary_source(struct object_database *odb,
return source->next;
}
-static void free_object_directory(struct odb_source *source)
+static void odb_source_free(struct odb_source *source)
{
free(source->path);
odb_clear_loose_cache(source);
@@ -387,7 +387,7 @@ void odb_restore_primary_source(struct object_database *odb,
BUG("we expect the old primary object store to be the first alternate");
odb->sources = restore_source;
- free_object_directory(cur_source);
+ odb_source_free(cur_source);
}
char *compute_alternate_path(const char *path, struct strbuf *err)
@@ -1015,13 +1015,13 @@ struct object_database *odb_new(struct repository *repo)
return o;
}
-static void free_object_directories(struct object_database *o)
+static void odb_free_sources(struct object_database *o)
{
while (o->sources) {
struct odb_source *next;
next = o->sources->next;
- free_object_directory(o->sources);
+ odb_source_free(o->sources);
o->sources = next;
}
kh_destroy_odb_path_map(o->source_by_path);
@@ -1039,7 +1039,7 @@ void odb_clear(struct object_database *o)
o->commit_graph = NULL;
o->commit_graph_attempted = 0;
- free_object_directories(o);
+ odb_free_sources(o);
o->sources_tail = NULL;
o->loaded_alternates = 0;