submodule-config: allow submodule_free to handle arbitrary repositories
[gitweb.git] / submodule-config.c
index 2aa8a1747f8586839aa3036fbbc59f6c716c6128..5b4f0baae815bdfbc21651cdf2648f6c92dce3a6 100644 (file)
@@ -642,8 +642,8 @@ const struct submodule *submodule_from_cache(struct repository *repo,
                           key, lookup_path);
 }
 
-void submodule_free(void)
+void submodule_free(struct repository *r)
 {
-       if (the_repository->submodule_cache)
-               submodule_cache_clear(the_repository->submodule_cache);
+       if (r->submodule_cache)
+               submodule_cache_clear(r->submodule_cache);
 }