From 47ff3e5655ec28ab946ae842c2929cc87146295e Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Thu, 26 Oct 2023 11:50:12 -0300 Subject: [PATCH] tests/git-helper: cancel any previous rebase left halfway In bare-metal machines the git tree might get on unstable state with the previous rebase left halfway. So let's attempt to abort any rebase before. Fixes #8318 Signed-off-by: Wainer dos Santos Moschetta (cherry picked from commit 0ce0abffa6e354a69ee95cb24dc0c7c6f03d00d8) --- tests/git-helper.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/git-helper.sh b/tests/git-helper.sh index 81ec53cfa1..32d0384fa7 100755 --- a/tests/git-helper.sh +++ b/tests/git-helper.sh @@ -19,6 +19,8 @@ function add_kata_bot_info() { function rebase_atop_of_the_latest_target_branch() { if [ -n "${TARGET_BRANCH}" ]; then echo "Rebasing atop of the latest ${TARGET_BRANCH}" + # Recover from any previous rebase left halfway + git rebase --abort 2> /dev/null || true git rebase origin/${TARGET_BRANCH} fi }