]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object-file: rename files transaction prepare function
authorJustin Tobler <jltobler@gmail.com>
Fri, 10 Jul 2026 16:37:12 +0000 (11:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2026 20:21:52 +0000 (13:21 -0700)
The "files" ODB transaction backend lazily creates a temporary object
directory when the first loose object is written to the transaction via
`prepare_loose_object_transaction()`. In a subsequent commit, the
temporary directory is used to also write packfiles to.

Rename the function to `odb_transaction_files_prepare()` accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c

index bce941874eb994c8dbaf391ede6c84a09fa96f56..9f5e51eda4be4d4ac95d209b7e03dd5c71b16dba 100644 (file)
@@ -499,7 +499,7 @@ struct odb_transaction_files {
        struct transaction_packfile packfile;
 };
 
-static void prepare_loose_object_transaction(struct odb_transaction *base)
+static void odb_transaction_files_prepare(struct odb_transaction *base)
 {
        struct odb_transaction_files *transaction =
                container_of_or_null(base, struct odb_transaction_files, base);
@@ -760,7 +760,7 @@ int write_loose_object(struct odb_source_loose *loose,
        static struct strbuf filename = STRBUF_INIT;
 
        if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT))
-               prepare_loose_object_transaction(loose->base.odb->transaction);
+               odb_transaction_files_prepare(loose->base.odb->transaction);
 
        odb_loose_path(loose, &filename, oid);
 
@@ -824,7 +824,7 @@ int odb_source_loose_write_stream(struct odb_source_loose *loose,
        int hdrlen;
 
        if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT))
-               prepare_loose_object_transaction(loose->base.odb->transaction);
+               odb_transaction_files_prepare(loose->base.odb->transaction);
 
        /* Since oid is not determined, save tmp file to odb path. */
        strbuf_addf(&filename, "%s/", loose->base.path);