Merge branch 'jt/object-file-use-container-of' into next

Code clean-up.

* jt/object-file-use-container-of:
  object-file.c: avoid container_of() of a NULL container
This commit is contained in:
Junio C Hamano
2026-02-22 12:28:00 -08:00

View File

@@ -735,7 +735,7 @@ struct odb_transaction_files {
static void prepare_loose_object_transaction(struct odb_transaction *base)
{
struct odb_transaction_files *transaction =
container_of(base, struct odb_transaction_files, base);
container_of_or_null(base, struct odb_transaction_files, base);
/*
* We lazily create the temporary object directory
@@ -755,7 +755,7 @@ static void fsync_loose_object_transaction(struct odb_transaction *base,
int fd, const char *filename)
{
struct odb_transaction_files *transaction =
container_of(base, struct odb_transaction_files, base);
container_of_or_null(base, struct odb_transaction_files, base);
/*
* If we have an active ODB transaction, we issue a call that