summaryrefslogtreecommitdiff
path: root/src/submodule.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-05-30 10:34:58 +0200
committerPatrick Steinhardt <ps@pks.im>2018-05-30 10:35:43 +0200
commit9c698a256f27bfe98df39322c3e29a02d48f6973 (patch)
tree5d2cc4e8cc8599801b68ba523c473665c0a5bf95 /src/submodule.c
parentcf5030a37f33c42f6369732b0e328e42ef48432c (diff)
downloadlibgit2-9c698a256f27bfe98df39322c3e29a02d48f6973.tar.gz
submodule: remove useless mask computations
Previous to dfda2f68e (submodule: remove the per-repo cache, 2015-04-27), we tried to cache our submodules per repository to avoid having to reload it too frequently. As it created some headaches with regards to multithreading, we removed that cache. Previous to that removal, we had to compute what submodule status to refresh. The mask computation was not removed, though, resulting in confusing and actually dead code. While it seems like the mask is currently in use in a conditional, it is not, as we unconditionally assign to the mask previous to that condition. Remove all mask computations to clean up stale code.
Diffstat (limited to 'src/submodule.c')
-rw-r--r--src/submodule.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/submodule.c b/src/submodule.c
index db92090cb..d0aef2eeb 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -572,7 +572,6 @@ int git_submodule__map(git_repository *repo, git_strmap *map)
git_buf path = GIT_BUF_INIT;
git_submodule *sm;
git_config *mods = NULL;
- uint32_t mask;
assert(repo && map);
@@ -586,22 +585,6 @@ int git_submodule__map(git_repository *repo, git_strmap *map)
if (wd && (error = git_buf_joinpath(&path, wd, GIT_MODULES_FILE)) < 0)
goto cleanup;
- /* clear submodule flags that are to be refreshed */
- mask = 0;
- mask |= GIT_SUBMODULE_STATUS_IN_INDEX |
- GIT_SUBMODULE_STATUS__INDEX_FLAGS |
- GIT_SUBMODULE_STATUS__INDEX_OID_VALID |
- GIT_SUBMODULE_STATUS__INDEX_MULTIPLE_ENTRIES;
-
- mask |= GIT_SUBMODULE_STATUS_IN_HEAD |
- GIT_SUBMODULE_STATUS__HEAD_OID_VALID;
- mask |= GIT_SUBMODULE_STATUS_IN_CONFIG;
- if (mask != 0)
- mask |= GIT_SUBMODULE_STATUS_IN_WD |
- GIT_SUBMODULE_STATUS__WD_SCANNED |
- GIT_SUBMODULE_STATUS__WD_FLAGS |
- GIT_SUBMODULE_STATUS__WD_OID_VALID;
-
/* add submodule information from .gitmodules */
if (wd) {
lfc_data data = { 0 };
@@ -630,7 +613,7 @@ int git_submodule__map(git_repository *repo, git_strmap *map)
goto cleanup;
}
/* shallow scan submodules in work tree as needed */
- if (wd && mask != 0) {
+ if (wd) {
git_strmap_foreach_value(map, sm, {
submodule_load_from_wd_lite(sm);
});