@@ -64,17 +64,27 @@ static int remote_odb_config(const char *var, const char *value, void *data)
return 0;
}
-static void remote_odb_init(void)
+static void remote_odb_do_init(int force)
{
static int initialized;
- if (initialized)
+ if (!force && initialized)
return;
initialized = 1;
git_config(remote_odb_config, NULL);
}
+static inline void remote_odb_init(void)
+{
+ remote_odb_do_init(0);
+}
+
+void remote_odb_reinit(void)
+{
+ remote_odb_do_init(1);
+}
+
struct odb_helper *find_odb_helper(const char *remote)
{
remote_odb_init();
@@ -1,6 +1,7 @@
#ifndef REMOTE_ODB_H
#define REMOTE_ODB_H
+extern void remote_odb_reinit(void);
extern struct odb_helper *find_odb_helper(const char *remote);
extern int has_remote_odb(void);
extern int remote_odb_get_direct(const struct object_id *oids, int oid_nr);