From c5fdf4902f57c3f4f00844e1516357f9a773c8aa Mon Sep 17 00:00:00 2001 From: Marco Borgeaud Date: Wed, 11 Dec 2024 15:53:08 +0100 Subject: [PATCH] [NFC] Only fetch HEADs of tags & master for coverage computation Download 375M instead of 712M. --- rspec-tools/rspec_tools/coverage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rspec-tools/rspec_tools/coverage.py b/rspec-tools/rspec_tools/coverage.py index 1ed7936a642..ae0730d97f3 100644 --- a/rspec-tools/rspec_tools/coverage.py +++ b/rspec-tools/rspec_tools/coverage.py @@ -187,7 +187,9 @@ def checkout_repo(repo): if token: git_url=f"https://oauth2:{token}@github.com/SonarSource/{repo}" if not os.path.exists(repo): - return Repo.clone_from(git_url, repo) + repo = Repo.clone_from(git_url, repo, depth=1, single_branch=True) + repo.remote('origin').fetch('refs/tags/*:refs/tags/*', depth=1) + return repo else: return Repo(repo)