Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Return type mismatch in repo.submodule_update() #2077

Copy link
Copy link
@extrwi

Description

@extrwi
Issue body actions

Hello everyone! repo.submodule_update is annotated to return an Iterator[Submodule] (and I hoped it might return an iterator of modified modules or something similar).

GitPython/git/repo/base.py

Lines 523 to 531 in ba5c10d

def submodule_update(self, *args: Any, **kwargs: Any) -> Iterator[Submodule]:
"""Update the submodules, keeping the repository consistent as it will
take the previous state into consideration.
:note:
For more information, please see the documentation of
:meth:`RootModule.update <git.objects.submodule.root.RootModule.update>`.
"""
return RootModule(self).update(*args, **kwargs)

However, RootModule.update just returns self (type RootModule):

def update( # type: ignore[override]
self,
previous_commit: Union[Commit_ish, str, None] = None,
recursive: bool = True,
force_remove: bool = False,
init: bool = True,
to_latest_revision: bool = False,
progress: Union[None, "RootUpdateProgress"] = None,
dry_run: bool = False,
force_reset: bool = False,
keep_going: bool = False,
) -> "RootModule":

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.