From: Daan De Meyer Date: Fri, 21 Mar 2025 20:34:12 +0000 (+0100) Subject: fetch-distro: Fetch before we switch branches X-Git-Tag: v258-rc1~1022 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07a6e1db06c9603d83e4329099b87a60a35662e7;p=thirdparty%2Fsystemd.git fetch-distro: Fetch before we switch branches Otherwise the branch we're switching to might not exist yet. --- 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: