Skip to content

Commit 7ee7c6d

Browse files
committed
Merge bitcoin/bitcoin#28332: test: previous releases: speed up fetching sources with shallow clone
360ac64 test: previous releases: speed up fetching sources with shallow clone (Sebastian Falbesoner) Pull request description: For the sake of building previous releases, fetching the whole history of the repository for each version seems to be overkill as it takes much more time, bandwidth and disk space than necessary. Create a shallow clone instead with history truncated to the one commit of the version tag, which is directly checked out in the same command. This has the nice side-effect that we can remove the extra `git checkout` step after as it's not needed anymore. Note that it might look confusing to pass a _tag_ to a parameter named `--branch`, but the git-clone manpage explicitly states that this is supported. ACKs for top commit: MarcoFalke: lgtm ACK 360ac64 Tree-SHA512: c885a695c1ea90895cf7a785540c24e8ef8d1d9ea78db28143837240586beb6dfb985b8b0b542d2f64e2f0ffdca7c65fc3d55f44b5e1b22cc5535bc044566f86
2 parents e8989f2 + 360ac64 commit 7ee7c6d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

test/get_previous_releases.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,11 @@ def build_release(tag, args) -> int:
207207
print('Tag {} not found'.format(tag))
208208
return 1
209209
ret = subprocess.run([
210-
'git', 'clone', githubUrl, tag
210+
'git', 'clone', f'--branch={tag}', '--depth=1', githubUrl, tag
211211
]).returncode
212212
if ret:
213213
return ret
214214
with pushd(tag):
215-
ret = subprocess.run(['git', 'checkout', tag]).returncode
216-
if ret:
217-
return ret
218215
host = args.host
219216
if args.depends:
220217
with pushd('depends'):

0 commit comments

Comments
 (0)