test_git.sh: declare restore_opts and assign separately

This avoids masking return values. Fixes SC2155. Part of #891.
This commit is contained in:
Raúl Benencia 2024-06-28 11:29:31 -07:00
parent 0e81260572
commit d12d9f2a01
1 changed files with 2 additions and 1 deletions

View File

@ -908,7 +908,8 @@ function run_test() {
shift shift
declare -g "$retvar" declare -g "$retvar"
local restore_opts=$(set +o) local restore_opts
restore_opts=$(set +o)
set +o errexit set +o errexit
set +o nounset set +o nounset
set +o pipefail set +o pipefail