aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/cat-file.c7
-rw-r--r--builtin/pack-objects.c12
2 files changed, 12 insertions, 7 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index b6f12f41d6..cd13a3a89f 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -848,6 +848,9 @@ static void batch_each_object(struct batch_options *opt,
.callback = callback,
.payload = _payload,
};
+ struct odb_for_each_object_options opts = {
+ .flags = flags,
+ };
struct bitmap_index *bitmap = NULL;
struct odb_source *source;
@@ -860,7 +863,7 @@ static void batch_each_object(struct batch_options *opt,
odb_prepare_alternates(the_repository->objects);
for (source = the_repository->objects->sources; source; source = source->next) {
int ret = odb_source_loose_for_each_object(source, NULL, batch_one_object_oi,
- &payload, flags);
+ &payload, &opts);
if (ret)
break;
}
@@ -884,7 +887,7 @@ static void batch_each_object(struct batch_options *opt,
for (source = the_repository->objects->sources; source; source = source->next) {
struct odb_source_files *files = odb_source_files_downcast(source);
int ret = packfile_store_for_each_object(files->packed, &oi,
- batch_one_object_oi, &payload, flags);
+ batch_one_object_oi, &payload, &opts);
if (ret)
break;
}
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index da1087930c..88388254d9 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -4359,6 +4359,12 @@ static void add_objects_in_unpacked_packs(void)
{
struct odb_source *source;
time_t mtime;
+ struct odb_for_each_object_options opts = {
+ .flags = ODB_FOR_EACH_OBJECT_PACK_ORDER |
+ ODB_FOR_EACH_OBJECT_LOCAL_ONLY |
+ ODB_FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS |
+ ODB_FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS,
+ };
struct object_info oi = {
.mtimep = &mtime,
};
@@ -4371,11 +4377,7 @@ static void add_objects_in_unpacked_packs(void)
continue;
if (packfile_store_for_each_object(files->packed, &oi,
- add_object_in_unpacked_pack, NULL,
- ODB_FOR_EACH_OBJECT_PACK_ORDER |
- ODB_FOR_EACH_OBJECT_LOCAL_ONLY |
- ODB_FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS |
- ODB_FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS))
+ add_object_in_unpacked_pack, NULL, &opts))
die(_("cannot open pack index"));
}
}