]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fetch-distro: Fetch before we switch branches
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 21 Mar 2025 20:34:12 +0000 (21:34 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 8 Apr 2025 19:52:11 +0000 (20:52 +0100)
Otherwise the branch we're switching to might not exist yet.

(cherry picked from commit 07a6e1db06c9603d83e4329099b87a60a35662e7)
(cherry picked from commit 503ecb4914ae11f4a1daafd844125bbd7fe20a84)

tools/fetch-distro.py

index 9fc5b1bfa62a377c1412b25d9101896ab91f3f6d..cf9658e8ad45999438edafa7b86d9bd596c285c8 100755 (executable)
@@ -79,12 +79,12 @@ def update_distro(args, distro: str, config: dict):
     branch = config['Environment']['GIT_BRANCH']
     old_commit = config['Environment']['GIT_COMMIT']
 
-    cmd = ['git', '-C', f'pkg/{distro}', 'switch', branch]
+    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}', 'fetch', 'origin', '-v',
-           f'{branch}:remotes/origin/{branch}']
+    cmd = ['git', '-C', f'pkg/{distro}', 'switch', branch]
     print(f"+ {shlex.join(cmd)}")
     subprocess.check_call(cmd)