I hit some quite confusing (to me anyway) corner cases in `git submodule` handling of checking out revisions where submodules have been added or removed. If you clone a repo with an "old" submodule which is missing from HEAD, and then try to checkout an older revision, you can sometimes get: fatal: not a git repository: ../.git/modules/old fatal: could not reset submodule index If you clone a repo with a "new" submodule, and then checkout an older revision where it is deleted, you can sometimes find that new submodule is left lying around. Luke Diamand (1): Test case for checkout of added/deleted submodules in clones t/t5619-submodules-missing.sh | 104 ++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 t/t5619-submodules-missing.sh -- 2.28.0.762.g324f61785e