Skip to content

Commit ec2e2c8

Browse files
committed
Allow relative path url in submodules for submodule_update
1 parent 4d529b7 commit ec2e2c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git/objects/submodule/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import stat
1212
import sys
1313
import uuid
14+
import urllib
1415

1516
import git
1617
from git.cmd import Git
@@ -799,9 +800,13 @@ def update(
799800
+ "Cloning url '%s' to '%s' in submodule %r" % (self.url, checkout_module_abspath, self.name),
800801
)
801802
if not dry_run:
803+
if self.url.startswith("."):
804+
url = urllib.parse.urljoin(self.repo.remotes.origin.url + "/", self.url)
805+
else:
806+
url = self.url
802807
mrepo = self._clone_repo(
803808
self.repo,
804-
self.url,
809+
url,
805810
self.path,
806811
self.name,
807812
n=True,

0 commit comments

Comments
 (0)