Skip to content

submodule update doesn't work with relative submodule paths (in GitPython 2.1.14) #944

@Genovese-martijn

Description

@Genovese-martijn

When using the git.objects.submodules.base.Submodule.update method (https://gitpython.readthedocs.io/en/stable/reference.html#git.objects.submodule.base.Submodule.update), the git python module seems to fake a git submodule call with git clone. It executes git clone -n --separate-git-dir=<workspace>/.git/modules/<submodule_path> -v <submodule_url> <workspace>/<submodule_path>. This command doesn't work when a submodule is specified as a relative path in the .gitmodules path. For example:

[submodule "main_project/submodule"]
  path = main_project/submodule
  url = ../../other_project/some_module.git

The git.objects.submodules.base.Submodule.update then fails with `repository '../../other_project/some_module.git' does not exist.

The regular git submodule command is able to resolve the paths.

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