Skip to content

Allow relative path url in submodules for submodule_update #2062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion git/objects/submodule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import stat
import sys
import uuid
import urllib

import git
from git.cmd import Git
Expand Down Expand Up @@ -799,9 +800,13 @@ def update(
+ "Cloning url '%s' to '%s' in submodule %r" % (self.url, checkout_module_abspath, self.name),
)
if not dry_run:
if self.url.startswith("."):
url = urllib.parse.urljoin(self.repo.remotes.origin.url + "/", self.url)
else:
url = self.url
mrepo = self._clone_repo(
self.repo,
self.url,
url,
self.path,
self.name,
n=True,
Expand Down
Loading