MCPcopy Create free account
hub / github.com/git/git / prepare_loose_object_transaction

Function prepare_loose_object_transaction

object-file.c:502–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500};
501
502static 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
521static void fsync_loose_object_transaction(struct odb_transaction *base,
522 int fd, const char *filename)

Callers 2

write_loose_objectFunction · 0.85

Calls 2

tmp_objdir_createFunction · 0.85

Tested by

no test coverage detected