fetch-distro: Fetch before we switch branches

Otherwise the branch we're switching to might not exist yet.
This commit is contained in:
Daan De Meyer
2025-03-21 21:21:37 +00:00
committed by Luca Boccassi
parent 655b0365e6
commit 07a6e1db06
+4 -4
View File
@@ -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: