From 2cc6a94661c100b4b25e9fda781d292e5968e28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=BCller?= Date: Tue, 29 Apr 2025 01:14:52 +0200 Subject: [PATCH] Back up changes before build and restore afterwards --- snippets/basop/build-binaries.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/snippets/basop/build-binaries.sh b/snippets/basop/build-binaries.sh index 1d737db..cd17901 100755 --- a/snippets/basop/build-binaries.sh +++ b/snippets/basop/build-binaries.sh @@ -36,7 +36,17 @@ fi current_commit_sha="$(git rev-parse HEAD)" -git restore . +restore_stash() { + if [[ "$(git stash list)" != "" ]]; then + git stash pop + fi +} +trap restore_stash EXIT + +# store potential changes +# should never fail, even if there is nothing to be stored +git stash + git checkout "$branch_to_check_out" bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/activate-debug-mode-info-if-set.sh -- GitLab