Commit 8dc612b3 authored by Jan Kiene's avatar Jan Kiene
Browse files

remove obsolete variable + add trap for git stash back

parent 3b640bed
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ variables:
  GIT_CLEAN_FLAGS: -ffdxq
  TESTCASE_TIMEOUT_STV_SANITIZERS: 240
  TESTCASE_TIMEOUT_LTV_SANITIZERS: 2400
  BASOP_REFERENCE_BRANCH: "ivas-float-update"
  SCALE_FACTOR: "3.162"
  BASOP_CI_BRANCH_PC_REPO: "basop-ci-branch"
  PYTEST_ADDOPTS: ""
+9 −4
Original line number Diff line number Diff line
@@ -53,6 +53,13 @@ echo "Building $mode binaries from branch $ref_to_check_out"
# working_dir is set as per input argument
pushd "$working_dir"

restore_stash() {
  if [[ "$(git stash list)" != "" ]]; then
    git stash pop
  fi
}
trap restore_stash EXIT

# the git SHA and stash restoring mechanisms is not really necessary for float-ref branches, but also should not harm, so no if here
current_commit_sha="$(git rev-parse HEAD)"

@@ -80,9 +87,7 @@ git rev-parse HEAD >"$commit_file"
git checkout "$current_commit_sha"

# this used to be a TRAP for EXIT before, but now with the popd at the end, we might not be in the corresponding git repo anymore at EXIT
# instead, this is called manually here now
if [[ "$(git stash list)" != "" ]]; then
  git stash pop
fi
# we keep the trap to clean up incase of some error and additionally this is called manually here now
restore_stash

popd