MCPcopy Create free account
hub / github.com/libgit2/pygit2 / cache_all

Method cache_all

pygit2/submodules.py:371–382  ·  view source on GitHub ↗

Load and cache all submodules in the repository. Because the `.gitmodules` file is unstructured, loading submodules is an O(N) operation. Any operation that requires accessing all submodules is O(N^2) in the number of submodules, if it has to look each one up indiv

(self)

Source from the content-addressed store, hash-verified

369 return SubmoduleStatus(cstatus[0])
370
371 def cache_all(self) -> None:
372 """
373 Load and cache all submodules in the repository.
374
375 Because the `.gitmodules` file is unstructured, loading submodules is an
376 O(N) operation. Any operation that requires accessing all submodules is O(N^2)
377 in the number of submodules, if it has to look each one up individually.
378 This function loads all submodules and caches them so that subsequent
379 submodule lookups by name are O(1).
380 """
381 err = C.git_repository_submodule_cache_all(self._repository._repo)
382 check_error(err)
383
384 def cache_clear(self) -> None:
385 """

Callers 1

test_submodule_cacheFunction · 0.80

Calls 1

check_errorFunction · 0.85

Tested by 1

test_submodule_cacheFunction · 0.64