static struct strbuf buf = STRBUF_INIT;
int fd;
- *path = odb_loose_path(loose->source, &buf, oid);
+ *path = odb_loose_path(&loose->files->base, &buf, oid);
fd = git_open(*path);
if (fd >= 0)
return fd;
static int quick_has_loose(struct odb_source_loose *loose,
const struct object_id *oid)
{
- return !!oidtree_contains(odb_source_loose_cache(loose->source, oid), oid);
+ return !!oidtree_contains(odb_source_loose_cache(&loose->files->base, oid), oid);
}
/*
CALLOC_ARRAY(files, 1);
odb_source_init(&files->base, odb, ODB_SOURCE_FILES, path, local);
- files->loose = odb_source_loose_new(&files->base);
+ files->loose = odb_source_loose_new(files);
files->packed = packfile_store_new(&files->base);
files->base.free = odb_source_files_free;
#include "git-compat-util.h"
#include "odb/source-loose.h"
-struct odb_source_loose *odb_source_loose_new(struct odb_source *source)
+struct odb_source_loose *odb_source_loose_new(struct odb_source_files *files)
{
struct odb_source_loose *loose;
CALLOC_ARRAY(loose, 1);
- loose->source = source;
+ loose->files = files;
return loose;
}
#include "odb/source.h"
+struct odb_source_files;
struct object_database;
struct oidtree;
* file per object. This source is part of the files source.
*/
struct odb_source_loose {
- struct odb_source *source;
+ struct odb_source_files *files;
/*
* Used to store the results of readdir(3) calls when we are OK
struct loose_object_map *map;
};
-struct odb_source_loose *odb_source_loose_new(struct odb_source *source);
+struct odb_source_loose *odb_source_loose_new(struct odb_source_files *files);
#endif