summaryrefslogtreecommitdiff
path: root/src/submodule.h
diff options
context:
space:
mode:
authorBrock Peabody <bpeabody@twosigma.com>2016-11-23 18:32:48 -0500
committerDavid Turner <dturner@twosigma.com>2017-01-20 17:33:56 -0500
commit4d99c4cfc604bb141fd4e1423e934ebd3fb7e2a7 (patch)
tree7fa6287b0ecfb6873dfd74eaf819cff1cf396bc2 /src/submodule.h
parentca05857e71f8d11582b1ad82f63c6a61e96fe20e (diff)
downloadlibgit2-4d99c4cfc604bb141fd4e1423e934ebd3fb7e2a7.tar.gz
Allow for caching of submodules.
Added `git_repository_submodule_cache_all` to initialze a cache of submodules on the repository so that operations looking up N submodules are O(N) and not O(N^2). Added a `git_repository_submodule_cache_clear` function to remove the cache. Also optimized the function that loads all submodules as it was itself O(N^2) w.r.t the number of submodules, having to loop through the `.gitmodules` file once per submodule. I changed it to process the `.gitmodules` file once, into a map. Signed-off-by: David Turner <dturner@twosigma.com>
Diffstat (limited to 'src/submodule.h')
-rw-r--r--src/submodule.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/submodule.h b/src/submodule.h
index 2ef2031b3..456a93979 100644
--- a/src/submodule.h
+++ b/src/submodule.h
@@ -143,4 +143,7 @@ extern int git_submodule_parse_ignore(
extern int git_submodule_parse_update(
git_submodule_update_t *out, const char *value);
+extern int git_submodule__map(
+ git_repository *repo,
+ git_strmap *map);
#endif