mirror of
https://github.com/git/git.git
synced 2026-03-01 18:24:00 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user