summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-29 20:54:17 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-29 20:54:17 +0200
commitcf4030b04b37425911688fb6a1b9f542b6ad8eab (patch)
treea483a8be44323823e392cd326180de69185d85fc
parentca2466ff4022cd539e8126ac9746fd25977fc1cc (diff)
downloadlibgit2-cf4030b04b37425911688fb6a1b9f542b6ad8eab.tar.gz
submodule: remove some obsolete logic
Remove some of the logic that was left-over from the time we had a cache of submodules, plugging a leak of the submodule object in certain cases.
-rw-r--r--src/submodule.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/submodule.c b/src/submodule.c
index 796364bb8..f710f8d98 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1691,28 +1691,9 @@ static int submodule_load_from_config(
/* Deregister under name being replaced */
if (replaced) {
- git_submodule_free(sm);
git__free(replaced);
}
- /* Insert under alternate key */
- if (alternate) {
- void *old_sm = NULL;
-
- if (error < 0)
- goto done;
- if (error > 0)
- error = 0;
-
- GIT_REFCOUNT_INC(sm); /* increase refcount for new key */
-
- /* if we replaced an old module under this key, release the old one */
- if (old_sm && ((git_submodule *)old_sm) != sm) {
- git_submodule_free(old_sm);
- /* TODO: log warning about multiple submodules with same path */
- }
- }
-
/* TODO: Look up path in index and if it is present but not a GITLINK
* then this should be deleted (at least to match git's behavior)
*/