*/
void add_to_alternates_memory(const char *dir);
-/*
- * Populate an odb's loose object cache for one particular subdirectory (i.e.,
- * the one that corresponds to the first byte of objects you're interested in,
- * from 0 to 255 inclusive).
- */
-void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);
-
/*
* Populate and return the loose object cache array corresponding to the
* given object ID.
const struct object_id *oid)
{
int subdir_nr = oid->hash[0];
- odb_load_loose_cache(odb, subdir_nr);
- return &odb->loose_objects_cache[subdir_nr];
-}
-
-void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)
-{
struct strbuf buf = STRBUF_INIT;
if (subdir_nr < 0 ||
BUG("subdir_nr out of range");
if (odb->loose_objects_subdir_seen[subdir_nr])
- return;
+ return &odb->loose_objects_cache[subdir_nr];
strbuf_addstr(&buf, odb->path);
for_each_file_in_obj_subdir(subdir_nr, &buf,
&odb->loose_objects_cache[subdir_nr]);
odb->loose_objects_subdir_seen[subdir_nr] = 1;
strbuf_release(&buf);
+ return &odb->loose_objects_cache[subdir_nr];
}
void odb_clear_loose_cache(struct object_directory *odb)