From b5e4775b2436ef669542e79e71696311cdca4fa5 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Thu, 22 May 2025 12:36:53 +0200 Subject: [PATCH] test: simplify git clone command In some (ununderstood) cases the combination of `--no-single-branch` and `--depth=1` leads to the revision we want to check out not being available. Achilleas suggested to change the command to this instead. Signed-off-by: Simon de Vlieger --- test/cases/manifest_tests | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/cases/manifest_tests b/test/cases/manifest_tests index c0a6cbdf..c847b58c 100755 --- a/test/cases/manifest_tests +++ b/test/cases/manifest_tests @@ -110,9 +110,19 @@ def checkout_images_repo(ref, workdir: os.PathLike) -> str: print(f"Checking out '{OSBUILD_IMAGES_REPO_URL}' repository at ref '{ref}'") try: subprocess.check_call( - ["git", "clone", "--depth=1", "--no-single-branch", OSBUILD_IMAGES_REPO_URL, "images"], + ["git", "clone", OSBUILD_IMAGES_REPO_URL, "images"], cwd=workdir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) + + subprocess.check_call( + ["git", "fetch", "--all"], + cwd=images_path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + ) + + subprocess.check_call( + ["git", "checkout", ref], + cwd=images_path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + ) except subprocess.CalledProcessError as e: print(f"Failed to clone 'images' repository: {e.stdout.decode()}") sys.exit(1)