From 7253f7ca9fdc5a19f2a9ee5867a20182e10551d6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 14 Jul 2022 09:00:34 +0000 Subject: [PATCH] tests: fix incorrect --write-junit-xml code In 78d5e4cfb4b (tests: refactor --write-junit-xml code, 2022-05-21), this developer refactored the `--write-junit-xml` code a bit, including the part where the current test case's title was used in a `set` invocation, but failed to account for the fact that some test cases' titles start with a long option, which the `set` misinterprets as being intended for parsing. Let's fix this by using the `set -- <...>` form. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/test-lib-junit.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/test-lib-junit.sh b/t/test-lib-junit.sh index c959183c7e..79c31c788b 100644 --- a/t/test-lib-junit.sh +++ b/t/test-lib-junit.sh @@ -46,7 +46,7 @@ finalize_test_case_output () { shift case "$test_case_result" in ok) - set "$*" + set -- "$*" ;; failure) junit_insert="" fi - set "$1" " $junit_insert" + set -- "$1" " $junit_insert" ;; fixed) - set "$* (breakage fixed)" + set -- "$* (breakage fixed)" ;; broken) - set "$* (known breakage)" + set -- "$* (known breakage)" ;; skip) message="$(xml_attr_encode --no-lf "$skipped_reason")" - set "$1" " " + set -- "$1" " " ;; esac