Skip to content

Commit c2da110

Browse files
pks-tgitster
authored andcommitted
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 a1e2581 (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>
1 parent 0820a4b commit c2da110

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

odb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ struct odb_source *odb_set_temporary_primary_source(struct object_database *odb,
365365
return source->next;
366366
}
367367

368-
static void free_object_directory(struct odb_source *source)
368+
static void odb_source_free(struct odb_source *source)
369369
{
370370
free(source->path);
371371
odb_clear_loose_cache(source);
@@ -387,7 +387,7 @@ void odb_restore_primary_source(struct object_database *odb,
387387
BUG("we expect the old primary object store to be the first alternate");
388388

389389
odb->sources = restore_source;
390-
free_object_directory(cur_source);
390+
odb_source_free(cur_source);
391391
}
392392

393393
char *compute_alternate_path(const char *path, struct strbuf *err)
@@ -1015,13 +1015,13 @@ struct object_database *odb_new(struct repository *repo)
10151015
return o;
10161016
}
10171017

1018-
static void free_object_directories(struct object_database *o)
1018+
static void odb_free_sources(struct object_database *o)
10191019
{
10201020
while (o->sources) {
10211021
struct odb_source *next;
10221022

10231023
next = o->sources->next;
1024-
free_object_directory(o->sources);
1024+
odb_source_free(o->sources);
10251025
o->sources = next;
10261026
}
10271027
kh_destroy_odb_path_map(o->source_by_path);
@@ -1039,7 +1039,7 @@ void odb_clear(struct object_database *o)
10391039
o->commit_graph = NULL;
10401040
o->commit_graph_attempted = 0;
10411041

1042-
free_object_directories(o);
1042+
odb_free_sources(o);
10431043
o->sources_tail = NULL;
10441044
o->loaded_alternates = 0;
10451045

0 commit comments

Comments
 (0)