diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-27 19:27:29 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-22 17:02:54 +0200 |
commit | dfda2f68ea9602a6b0d08e36bd48e6a4899b12ff (patch) | |
tree | 55154c8535a53866661e94e5ec9a335d09698d38 /src/submodule.h | |
parent | 0c94deb90f1ce0e8caf171c85522c66ceb37a4ab (diff) | |
download | libgit2-dfda2f68ea9602a6b0d08e36bd48e6a4899b12ff.tar.gz |
submodule: remove the per-repo cache
Having this cache and giving them out goes against our multithreading
guarantees and it makes it impossible to use submodules in a
multi-threaded environment, as any thread can ask for a refresh which
may reallocate some string in the submodule struct which we've accessed
in a different one via a getter.
This makes the submodules behave more like remotes, where each object is
created upon request and not shared except explicitly by the user. This
means that some tests won't pass yet, as they assume they can affect the
submodule objects in the cache and that will affect later operations.
Diffstat (limited to 'src/submodule.h')
-rw-r--r-- | src/submodule.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/submodule.h b/src/submodule.h index 7a9bf9c92..d67796193 100644 --- a/src/submodule.h +++ b/src/submodule.h @@ -99,23 +99,6 @@ struct git_submodule { git_oid wd_oid; }; -/** - * The git_submodule_cache stores known submodules along with timestamps, - * etc. about when they were loaded - */ -typedef struct { - git_repository *repo; - git_strmap *submodules; - git_mutex lock; - - /* cache invalidation data */ - git_oid head_id; - git_oid index_checksum; - git_buf gitmodules_path; - git_futils_filestamp gitmodules_stamp; - git_futils_filestamp config_stamp; -} git_submodule_cache; - /* Force revalidation of submodule data cache (alloc as needed) */ extern int git_submodule_cache_refresh(git_repository *repo); @@ -137,9 +120,6 @@ enum { #define GIT_SUBMODULE_STATUS__CLEAR_INTERNAL(S) \ ((S) & ~(0xFFFFFFFFu << 20)) -/* Internal submodule check does not attempt to refresh cached data */ -extern bool git_submodule__is_submodule(git_repository *repo, const char *name); - /* Internal lookup does not attempt to refresh cached data */ extern int git_submodule__lookup( git_submodule **out, git_repository *repo, const char *path); |