Skip to content

Commit 925bdc9

Browse files
peffgitster
authored andcommitted
test-lib: handle TEST_OUTPUT_DIRECTORY with spaces
We are careful in test_done to handle a results directory with a space in it, but the "--tee" code path does not. Doing: export TEST_OUTPUT_DIRECTORY='/tmp/path with spaces' ./t000-init.sh --tee results in errors. Let's consistently double-quote our path variables so that this works. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b65a8d commit 925bdc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/test-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ done,*)
5858
mkdir -p "$TEST_OUTPUT_DIRECTORY/test-results"
5959
BASE="$TEST_OUTPUT_DIRECTORY/test-results/$(basename "$0" .sh)"
6060
(GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1;
61-
echo $? > $BASE.exit) | tee $BASE.out
62-
test "$(cat $BASE.exit)" = 0
61+
echo $? >"$BASE.exit") | tee "$BASE.out"
62+
test "$(cat "$BASE.exit")" = 0
6363
exit
6464
;;
6565
esac

0 commit comments

Comments
 (0)