diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 7db64d705..0d20305c6 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -1402,6 +1402,10 @@ def iter_items( # END handle keyerror # END handle critical error + # Make sure we are looking at a submodule object + if type(sm) != git.objects.submodule.base.Submodule: + continue + # fill in remaining info - saves time as it doesn't have to be parsed again sm._name = n if pc != repo.commit():