From 07a6e1db06c9603d83e4329099b87a60a35662e7 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 21 Mar 2025 21:34:12 +0100 Subject: [PATCH] fetch-distro: Fetch before we switch branches Otherwise the branch we're switching to might not exist yet. --- tools/fetch-distro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/fetch-distro.py b/tools/fetch-distro.py index 6d1c35ba6bf..b91833a68f0 100755 --- a/tools/fetch-distro.py +++ b/tools/fetch-distro.py @@ -97,16 +97,16 @@ def update_distro(args, distro: str, config: dict): subdir = config['Environment'].get('GIT_SUBDIR') old_commit = config['Environment']['GIT_COMMIT'] - cmd = ['git', '-C', f'pkg/{distro}', 'switch', branch] - print(f"+ {shlex.join(cmd)}") - subprocess.check_call(cmd) - if args.fetch: 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}', 'switch', branch] + print(f"+ {shlex.join(cmd)}") + subprocess.check_call(cmd) + cmd = ['git', '-C', f'pkg/{distro}', 'log', '-n1', '--format=%H', f'refs/remotes/origin/{branch}'] if subdir is not None: -- 2.47.3