@@ -1350,3 +1350,23 @@ def test_submodule_update_unsafe_options_allowed(self, rw_repo):
1350
1350
for unsafe_option in unsafe_options :
1351
1351
with self .assertRaises (GitCommandError ):
1352
1352
submodule .update (clone_multi_options = [unsafe_option ],allow_unsafe_options = True )
1353
+
1354
+ @with_rw_directory
1355
+ @_patch_git_config ("protocol.file.allow" ,"always" )
1356
+ def test_submodule_update_relative_url (self ,rwdir ):
1357
+ parent_path = osp .join (rwdir ,"parent" )
1358
+ parent_repo = git .Repo .init (parent_path )
1359
+ submodule_path = osp .join (rwdir ,"module" )
1360
+ submodule_repo = git .Repo .init (submodule_path )
1361
+ submodule_repo .git .commit (m = "initial commit" ,allow_empty = True )
1362
+
1363
+ parent_repo .git .submodule ("add" ,"../module" ,"module" )
1364
+ parent_repo .index .commit ("add submodule with relative URL" )
1365
+
1366
+ cloned_path = osp .join (rwdir ,"cloned_repo" )
1367
+ cloned_repo = git .Repo .clone_from (parent_path ,cloned_path )
1368
+
1369
+ cloned_repo .submodule_update (init = True ,recursive = True )
1370
+
1371
+ has_module = any (sm .name == "module" for sm in cloned_repo .submodules )
1372
+ assert has_module ,"Relative submodule was not updated properly"