| 500 | }; |
| 501 | |
| 502 | static void prepare_loose_object_transaction(struct odb_transaction *base) |
| 503 | { |
| 504 | struct odb_transaction_files *transaction = |
| 505 | container_of_or_null(base, struct odb_transaction_files, base); |
| 506 | |
| 507 | /* |
| 508 | * We lazily create the temporary object directory |
| 509 | * the first time an object might be added, since |
| 510 | * callers may not know whether any objects will be |
| 511 | * added at the time they call odb_transaction_files_begin. |
| 512 | */ |
| 513 | if (!transaction || transaction->objdir) |
| 514 | return; |
| 515 | |
| 516 | transaction->objdir = tmp_objdir_create(base->source->odb->repo, "bulk-fsync"); |
| 517 | if (transaction->objdir) |
| 518 | tmp_objdir_replace_primary_odb(transaction->objdir, 0); |
| 519 | } |
| 520 | |
| 521 | static void fsync_loose_object_transaction(struct odb_transaction *base, |
| 522 | int fd, const char *filename) |
no test coverage detected