summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-27 19:27:29 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-22 17:02:54 +0200
commitdfda2f68ea9602a6b0d08e36bd48e6a4899b12ff (patch)
tree55154c8535a53866661e94e5ec9a335d09698d38 /src/checkout.c
parent0c94deb90f1ce0e8caf171c85522c66ceb37a4ab (diff)
downloadlibgit2-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/checkout.c')
-rw-r--r--src/checkout.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 2893c63de..dab83c65a 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1860,11 +1860,6 @@ static int checkout_create_submodules(
git_diff_delta *delta;
size_t i;
- /* initial reload of submodules if .gitmodules was changed */
- if (data->reload_submodules &&
- (error = git_submodule_reload_all(data->repo, 1)) < 0)
- return error;
-
git_vector_foreach(&data->diff->deltas, i, delta) {
if (actions[i] & CHECKOUT_ACTION__DEFER_REMOVE) {
/* this has a blocker directory that should only be removed iff
@@ -1885,8 +1880,7 @@ static int checkout_create_submodules(
}
}
- /* final reload once submodules have been updated */
- return git_submodule_reload_all(data->repo, 1);
+ return 0;
}
static int checkout_lookup_head_tree(git_tree **out, git_repository *repo)