@@ -97,6 +97,28 @@ class ConfigVariationTest(t.NamedTuple):
9797 """ ,
9898 remote_list = ["secondremote" ],
9999 ),
100+ ConfigVariationTest (
101+ test_id = "expanded_repo_style_with_unprefixed_remote" ,
102+ config_tpl = """
103+ {tmp_path}/study/myrepo:
104+ {CLONE_NAME}:
105+ repo: git+file://{dir}
106+ remotes:
107+ git_scheme_repo: git@codeberg.org:tmux-python/tmuxp.git
108+ """ ,
109+ remote_list = ["git_scheme_repo" ],
110+ ),
111+ ConfigVariationTest (
112+ test_id = "expanded_repo_style_with_unprefixed_remote_2" ,
113+ config_tpl = """
114+ {tmp_path}/study/myrepo:
115+ {CLONE_NAME}:
116+ repo: git+file://{dir}
117+ remotes:
118+ git_scheme_repo: git@github.com:tony/vcspull.git
119+ """ ,
120+ remote_list = ["git_scheme_repo" ],
121+ ),
100122]
101123
102124
@@ -131,7 +153,6 @@ def test_config_variations(
131153 assert len (repos ) == 1
132154
133155 for repo_dict in repos :
134- repo_url = repo_dict ["url" ].replace ("git+" , "" )
135156 repo : GitSync = update_repo (repo_dict )
136157 remotes = repo .remotes () or {}
137158 remote_names = set (remotes .keys ())
@@ -142,7 +163,26 @@ def test_config_variations(
142163 for remote_name in remotes :
143164 current_remote = repo .remote (remote_name )
144165 assert current_remote is not None
145- assert current_remote .fetch_url == repo_url
166+ assert repo_dict is not None
167+ assert isinstance (remote_name , str )
168+ if (
169+ "remotes" in repo_dict
170+ and isinstance (repo_dict ["remotes" ], dict )
171+ and remote_name in repo_dict ["remotes" ]
172+ ):
173+ if repo_dict ["remotes" ][remote_name ].fetch_url .startswith (
174+ "git+file://"
175+ ):
176+ assert current_remote .fetch_url == repo_dict ["remotes" ][
177+ remote_name
178+ ].fetch_url .replace (
179+ "git+" , ""
180+ ), "Final git remote should chop git+ prefix"
181+ else :
182+ assert (
183+ current_remote .fetch_url
184+ == repo_dict ["remotes" ][remote_name ].fetch_url
185+ )
146186
147187
148188class UpdatingRemoteFixture (t .NamedTuple ):
0 commit comments