Skip to content

Commit 655a74c

Browse files
authored
Merge pull request #38411 from compnerd/tags
update_checkout: add a `--skip-tags` option
2 parents ff1f419 + f7bddc4 commit 655a74c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def update_all_repositories(args, config, scheme_name, cross_repos_pr):
260260

261261
def obtain_additional_swift_sources(pool_args):
262262
(args, repo_name, repo_info, repo_branch, remote, with_ssh, scheme_name,
263-
skip_history, skip_repository_list) = pool_args
263+
skip_history, skip_tags, skip_repository_list) = pool_args
264264

265265
env = dict(os.environ)
266266
env.update({'GIT_TERMINAL_PROMPT': 0})
@@ -270,14 +270,14 @@ def obtain_additional_swift_sources(pool_args):
270270
print("Cloning '" + repo_name + "'")
271271

272272
if skip_history:
273-
shell.run(['git', 'clone',
274-
'--recursive', '--depth', '1', '--branch',
275-
repo_branch, remote, repo_name],
273+
shell.run(['git', 'clone', '--recursive', '--depth', '1',
274+
'--branch', repo_branch, remote, repo_name] +
275+
(['--no-tags'] if skip_tags else []),
276276
env=env,
277277
echo=True)
278278
else:
279-
shell.run(['git', 'clone',
280-
'--recursive', remote, repo_name],
279+
shell.run(['git', 'clone', '--recursive', remote, repo_name] +
280+
(['--no-tags'] if skip_tags else []),
281281
env=env,
282282
echo=True)
283283
if scheme_name:
@@ -297,7 +297,8 @@ def obtain_additional_swift_sources(pool_args):
297297

298298

299299
def obtain_all_additional_swift_sources(args, config, with_ssh, scheme_name,
300-
skip_history, skip_repository_list):
300+
skip_history, skip_tags,
301+
skip_repository_list):
301302

302303
pool_args = []
303304
with shell.pushd(args.source_root, dry_run=False, echo=False):
@@ -342,7 +343,7 @@ def obtain_all_additional_swift_sources(args, config, with_ssh, scheme_name,
342343
continue
343344

344345
pool_args.append([args, repo_name, repo_info, repo_branch, remote,
345-
with_ssh, scheme_name, skip_history,
346+
with_ssh, scheme_name, skip_history, skip_tags,
346347
skip_repository_list])
347348

348349
if not pool_args:
@@ -470,6 +471,10 @@ def main():
470471
"--skip-history",
471472
help="Skip histories when obtaining sources",
472473
action="store_true")
474+
parser.add_argument(
475+
"--skip-tags",
476+
help="Skip tags when obtaining sources",
477+
action="store_true")
473478
parser.add_argument(
474479
"--skip-repository",
475480
metavar="DIRECTORY",
@@ -548,6 +553,7 @@ def main():
548553
clone = args.clone
549554
clone_with_ssh = args.clone_with_ssh
550555
skip_history = args.skip_history
556+
skip_tags = args.skip_tags
551557
scheme = args.scheme
552558
github_comment = args.github_comment
553559

@@ -584,6 +590,7 @@ def main():
584590
clone_with_ssh,
585591
scheme,
586592
skip_history,
593+
skip_tags,
587594
skip_repo_list)
588595

589596
# Quick check whether somebody is calling update in an empty directory

0 commit comments

Comments
 (0)