return files->loose->cache;
}
-void odb_source_loose_reprepare(struct odb_source *source)
-{
- struct odb_source_files *files = odb_source_files_downcast(source);
- odb_source_loose_clear_cache(files->loose);
-}
-
static int check_stream_oid(git_zstream *stream,
const char *hdr,
unsigned long size,
struct odb_read_stream;
struct odb_source;
-/* Reprepare the loose source by emptying the loose object cache. */
-void odb_source_loose_reprepare(struct odb_source *source);
-
int odb_source_loose_read_object_info(struct odb_source *source,
const struct object_id *oid,
struct object_info *oi,
static void odb_source_files_reprepare(struct odb_source *source)
{
struct odb_source_files *files = odb_source_files_downcast(source);
- odb_source_loose_reprepare(&files->base);
+ odb_source_reprepare(&files->loose->base);
packfile_store_reprepare(files->packed);
}
#include "odb/source-loose.h"
#include "oidtree.h"
-void odb_source_loose_clear_cache(struct odb_source_loose *loose)
+static void odb_source_loose_clear_cache(struct odb_source_loose *loose)
{
oidtree_clear(loose->cache);
FREE_AND_NULL(loose->cache);
sizeof(loose->subdir_seen));
}
+static void odb_source_loose_reprepare(struct odb_source *source)
+{
+ struct odb_source_loose *loose = odb_source_loose_downcast(source);
+ odb_source_loose_clear_cache(loose);
+}
+
static void odb_source_loose_reparent(const char *name UNUSED,
const char *old_cwd,
const char *new_cwd,
loose->files = files;
loose->base.free = odb_source_loose_free;
+ loose->base.reprepare = odb_source_loose_reprepare;
if (!is_absolute_path(loose->base.path))
chdir_notify_register(NULL, odb_source_loose_reparent, loose);
return container_of(source, struct odb_source_loose, base);
}
-void odb_source_loose_clear_cache(struct odb_source_loose *loose);
-
#endif