Skip to content

Commit 07a8cf3

Browse files
authored
[update-checkout] Skip cloning repos not specified in scheme. (#17949)
Previously, if a branch scheme did not specify a branch for a repository, update-checkout would crash. It's implied that all repositories should be cloned by all schemes, which is not necessarily the case. Now, repositories not specified in a scheme are not cloned. Addresses SR-8060.
1 parent ee760d8 commit 07a8cf3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

utils/update_checkout.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,21 @@ def obtain_all_additional_swift_sources(args, config, with_ssh, scheme_name,
268268
remote = config['https-clone-pattern'] % remote_repo_id
269269

270270
repo_branch = None
271+
repo_not_in_scheme = False
271272
if scheme_name:
272273
for v in config['branch-schemes'].values():
273274
if scheme_name not in v['aliases']:
274275
continue
276+
# If repo is not specified in the scheme, skip cloning it.
277+
if repo_name not in v['repos']:
278+
repo_not_in_scheme = True
279+
continue
275280
repo_branch = v['repos'][repo_name]
276281
break
277282
else:
278283
repo_branch = scheme_name
284+
if repo_not_in_scheme:
285+
continue
279286

280287
pool_args.append([args, repo_name, repo_info, repo_branch, remote,
281288
with_ssh, scheme_name, skip_history,

0 commit comments

Comments
 (0)