diff options
| author | lhchavez <lhchavez@lhchavez.com> | 2020-12-10 19:52:01 -0800 |
|---|---|---|
| committer | lhchavez <lhchavez@lhchavez.com> | 2020-12-10 20:23:12 -0800 |
| commit | 41da4e16eb01a7bb19c52bbc4251963be192ba69 (patch) | |
| tree | e5ec4485601b6a3303740c3787f72f0fd5941000 /src/submodule.h | |
| parent | 03ea04bfacc601c9d573fabf4c1da3f9f85e148c (diff) | |
| download | libgit2-41da4e16eb01a7bb19c52bbc4251963be192ba69.tar.gz | |
Cache the parsed submodule config when diffing
This change makes that anything that calls `git_diff__from_iterators`
(any of the `git_diff_xxx` functions) only need to parse the
`.gitmodules` file once. This can be avoided by calling
`git_repository_submodule_cache_all(...)`, but we can do that safely for
the user with no change in semantics.
Fixes: #5725
Diffstat (limited to 'src/submodule.h')
| -rw-r--r-- | src/submodule.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/submodule.h b/src/submodule.h index 57d95c3fc..f32f818ea 100644 --- a/src/submodule.h +++ b/src/submodule.h @@ -122,9 +122,9 @@ enum { #define GIT_SUBMODULE_STATUS__CLEAR_INTERNAL(S) \ ((S) & ~(0xFFFFFFFFu << 20)) -/* Internal lookup does not attempt to refresh cached data */ -extern int git_submodule__lookup( - git_submodule **out, git_repository *repo, const char *path); +/* Submodule lookup with an explicit cache */ +extern int git_submodule__lookup_with_cache( + git_submodule **out, git_repository *repo, const char *path, git_strmap *cache); /* Internal status fn returns status and optionally the various OIDs */ extern int git_submodule__status( |
