From 1cc96b9533037c284d2403a3294ecf0732caa959 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 14 Feb 2023 13:40:55 +0100 Subject: [PATCH] During test upgrade from another commit, fail immediately if that commit couldnt be checkedout --- lib/tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tests.sh b/lib/tests.sh index 5fe7a31..24f34a3 100644 --- a/lib/tests.sh +++ b/lib/tests.sh @@ -456,7 +456,9 @@ TEST_UPGRADE () { # Make a backup of the directory # and Change to the specified commit cp -a "$package_path" "${package_path}_back" - (cd "$package_path"; git checkout --force --quiet "$commit") + pushd "$package_path" + git checkout --force --quiet "$commit" || { log_error "Failed to checkout commit $commit ?"; return 1; } + popd LOAD_LXC_SNAPSHOT snap0