MCPcopy Index your code
hub / github.com/git/git / close_loose_object

Function close_loose_object

object-file.c:578–595  ·  view source on GitHub ↗

Finalize a file on disk, and close it. */

Source from the content-addressed store, hash-verified

576
577/* Finalize a file on disk, and close it. */
578static void close_loose_object(struct odb_source_loose *loose,
579 int fd, const char *filename)
580{
581 if (loose->base.will_destroy)
582 goto out;
583
584 if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT))
585 fsync_loose_object_transaction(loose->base.odb->transaction, fd, filename);
586 else if (fsync_object_files > 0)
587 fsync_or_die(fd, filename);
588 else
589 fsync_component_or_die(FSYNC_COMPONENT_LOOSE_OBJECT, fd,
590 filename);
591
592out:
593 if (close(fd) != 0)
594 die_errno(_("error when closing loose object file"));
595}
596
597/* Size of directory component, including the ending '/' */
598static inline int directory_size(const char *filename)

Callers 2

write_loose_objectFunction · 0.85

Calls 5

batch_fsync_enabledFunction · 0.85
fsync_or_dieFunction · 0.85
fsync_component_or_dieFunction · 0.85
die_errnoFunction · 0.85

Tested by

no test coverage detected