During test upgrade from another commit, fail immediately if that commit couldnt be checkedout

This commit is contained in:
Alexandre Aubin 2023-02-14 13:40:55 +01:00
parent caaf968b0d
commit 1cc96b9533

View file

@ -456,7 +456,9 @@ TEST_UPGRADE () {
# Make a backup of the directory # Make a backup of the directory
# and Change to the specified commit # and Change to the specified commit
cp -a "$package_path" "${package_path}_back" 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 LOAD_LXC_SNAPSHOT snap0