diff --git a/odb/source-loose.c b/odb/source-loose.c index 3c9edba46a..b2fbccd3c0 100644 --- a/odb/source-loose.c +++ b/odb/source-loose.c @@ -599,7 +599,7 @@ static int odb_source_loose_freshen_object(struct odb_source *source, static void close_loose_object(struct odb_source_loose *loose, int fd, const char *filename) { - if (loose->base.will_destroy) + if (loose->will_destroy) goto out; if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT)) diff --git a/odb/source-loose.h b/odb/source-loose.h index 3cf2e1f8f1..7c7e845fe3 100644 --- a/odb/source-loose.h +++ b/odb/source-loose.h @@ -28,6 +28,9 @@ struct odb_source_loose { /* Map between object IDs for loose objects. */ struct loose_object_map *map; + + /* Whether this is a source that will never be committed to disk. */ + int will_destroy; }; struct odb_source_loose *odb_source_loose_new(struct object_database *odb, diff --git a/odb/source.h b/odb/source.h index ea00873763..9fd2b2e5b5 100644 --- a/odb/source.h +++ b/odb/source.h @@ -81,11 +81,6 @@ struct odb_source { */ bool local; - /* - * This object store is ephemeral, so there is no need to fsync. - */ - int will_destroy; - /* * Path to the source. If this is a relative path, it is relative to * the current working directory. diff --git a/tmp-objdir.c b/tmp-objdir.c index 719b55e580..2f2ffbbc7d 100644 --- a/tmp-objdir.c +++ b/tmp-objdir.c @@ -14,7 +14,6 @@ #include "odb/source.h" #include "odb/source-files.h" #include "odb/source-loose.h" -#include "odb/source-packed.h" #include "repository.h" struct tmp_objdir { @@ -213,8 +212,7 @@ struct tmp_objdir *tmp_objdir_create(struct repository *r, * since the objects in the database may roll back. */ t->temp_dir = odb_files_dir_new(t->repo->objects, t->path.buf, false); - t->temp_dir->loose->base.will_destroy = will_destroy; - t->temp_dir->packed->base.will_destroy = will_destroy; + t->temp_dir->loose->will_destroy = will_destroy; t->temp_dir->next = files->dirs; t->orig_dir = files->dirs;