diff --git a/t/t1300-config.sh b/t/t1300-config.sh index d3d9adbb3d..c6661e61af 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -2083,12 +2083,13 @@ test_expect_success '--show-scope with --show-origin' ' ' test_expect_success 'override global and system config' ' - test_when_finished rm -f "$HOME"/.config/git && - + test_when_finished rm -f \"\$HOME\"/.gitconfig && cat >"$HOME"/.gitconfig <<-EOF && [home] config = true EOF + + test_when_finished rm -rf \"\$HOME\"/.config/git && mkdir -p "$HOME"/.config/git && cat >"$HOME"/.config/git/config <<-EOF && [xdg] diff --git a/t/t3700-add.sh b/t/t3700-add.sh index 8979c8a5f0..8689b48589 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -8,7 +8,7 @@ test_description='Test of git add, including the -- option.' TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh -. $TEST_DIRECTORY/lib-unique-files.sh +. "$TEST_DIRECTORY"/lib-unique-files.sh # Test the file mode "$1" of the file "$2" in the index. test_mode_in_index () { diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 20e9488196..2a4c3fd61c 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh -. $TEST_DIRECTORY/lib-unique-files.sh +. "$TEST_DIRECTORY"/lib-unique-files.sh test_expect_success 'usage on cmd and subcommand invalid option' ' test_expect_code 129 git stash --invalid-option 2>usage && diff --git a/t/t7609-mergetool--lib.sh b/t/t7609-mergetool--lib.sh index d848fe6442..330d6d603d 100755 --- a/t/t7609-mergetool--lib.sh +++ b/t/t7609-mergetool--lib.sh @@ -7,7 +7,7 @@ Testing basic merge tools options' . ./test-lib.sh test_expect_success 'mergetool --tool=vimdiff creates the expected layout' ' - . $GIT_BUILD_DIR/mergetools/vimdiff && + . "$GIT_BUILD_DIR"/mergetools/vimdiff && run_unit_tests ' diff --git a/t/test-lib.sh b/t/test-lib.sh index 55857af601..8cabb4d10f 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -57,14 +57,14 @@ fi # # prepend_var VAR : VALUE prepend_var () { - eval "$1=$3\${$1:+${3:+$2}\$$1}" + eval "$1=\"$3\${$1:+${3:+$2}\$$1}\"" } # If [AL]SAN is in effect we want to abort so that we notice # problems. The GIT_SAN_OPTIONS variable can be used to set common # defaults shared between [AL]SAN_OPTIONS. prepend_var GIT_SAN_OPTIONS : abort_on_error=1 -prepend_var GIT_SAN_OPTIONS : strip_path_prefix=\"$GIT_BUILD_DIR/\" +prepend_var GIT_SAN_OPTIONS : strip_path_prefix="$GIT_BUILD_DIR/" # If we were built with ASAN, it may complain about leaks # of program-lifetime variables. Disable it by default to lower