From 8e84e154457b0d55e823f670c377233b0211d2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 3 Jul 2024 16:10:49 +0200 Subject: [PATCH] tools/fetch-distro: only fetch the configured branch We don't need the other branches. This mostly cuts down on the noise in output. But add '-v' to show what we're fetching. --- tools/fetch-distro.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/fetch-distro.py b/tools/fetch-distro.py index dacaf28bcaf..e7f9f59104e 100755 --- a/tools/fetch-distro.py +++ b/tools/fetch-distro.py @@ -76,13 +76,14 @@ def checkout_distro(args, distro: str, config: dict): args.fetch = False # no need to fetch if we just cloned def update_distro(args, distro: str, config: dict): - cmd = ['git', '-C', f'pkg/{distro}', 'fetch'] - print(f"+ {shlex.join(cmd)}") - subprocess.check_call(cmd) - branch = config['Environment']['GIT_BRANCH'] old_commit = config['Environment']['GIT_COMMIT'] + cmd = ['git', '-C', f'pkg/{distro}', 'fetch', 'origin', '-v', + f'{branch}:remotes/origin/{branch}'] + print(f"+ {shlex.join(cmd)}") + subprocess.check_call(cmd) + cmd = ['git', '-C', f'pkg/{distro}', 'rev-parse', f'refs/remotes/origin/{branch}'] print(f"+ {shlex.join(cmd)}") new_commit = subprocess.check_output(cmd, text=True).strip()