const struct object_id *oid)
{
struct odb_source_files *files = odb_source_files_downcast(source);
- if (!packfile_store_read_object_stream(out, files->packed, oid) ||
+ if (!odb_source_read_object_stream(out, &files->packed->base, oid) ||
!odb_source_read_object_stream(out, &files->loose->base, oid))
return 0;
return -1;
#include "abspath.h"
#include "chdir-notify.h"
#include "dir.h"
+#include "git-zlib.h"
#include "mergesort.h"
#include "midx.h"
#include "odb/source-packed.h"
+#include "odb/streaming.h"
#include "packfile.h"
int find_pack_entry(struct odb_source_packed *store,
return 0;
}
+static int odb_source_packed_read_object_stream(struct odb_read_stream **out,
+ struct odb_source *source,
+ const struct object_id *oid)
+{
+ struct odb_source_packed *packed = odb_source_packed_downcast(source);
+ struct pack_entry e;
+
+ if (!find_pack_entry(packed, oid, &e))
+ return -1;
+
+ return packfile_read_object_stream(out, oid, e.p, e.offset);
+}
+
void (*report_garbage)(unsigned seen_bits, const char *path);
static void report_helper(const struct string_list *list,
packed->base.close = odb_source_packed_close;
packed->base.reprepare = odb_source_packed_reprepare;
packed->base.read_object_info = odb_source_packed_read_object_info;
+ packed->base.read_object_stream = odb_source_packed_read_object_stream;
if (!is_absolute_path(parent->base.path))
chdir_notify_register(NULL, odb_source_packed_reparent, packed);
return 0;
}
-
-int packfile_store_read_object_stream(struct odb_read_stream **out,
- struct odb_source_packed *store,
- const struct object_id *oid)
-{
- struct pack_entry e;
-
- if (!find_pack_entry(store, oid, &e))
- return -1;
-
- return packfile_read_object_stream(out, oid, e.p, e.offset);
-}
((p) = (eack_pack_data.entry ? eack_pack_data.entry->pack : NULL)); \
repo_for_each_pack_data_next(&eack_pack_data))
-int packfile_store_read_object_stream(struct odb_read_stream **out,
- struct odb_source_packed *store,
- const struct object_id *oid);
-
/*
* Open the packfile and add it to the store if it isn't yet known. Returns
* either the newly opened packfile or the preexisting packfile. Returns a