Git uses .gitmodules to store a link to your submodule project, but not a specific version. Therefore, when you switch the submodule branch, the git.gitmodules file does not change.
Instead, git updates the number of updates to your submodule when the submodule changes. If you look at your top module
git diff
you will see something like
-Subproject commit 829b869657418fdac7964c3671ed9a378f09c032
+Subproject commit 829b869657418fdac7964c3671ed9a378f09c032-dirty
, , ( ) .
.
: https://git-scm.com/book/en/v2/Git-Tools-Submodules#Starting-with-Submodules