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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jul 14, 2022 at 09:00 UTC 7253f7ca9fdc5a19f2a9ee5867a20182e10551d6
1 file changed +5 -5
t/test-lib-junit.sh
+5 -5
@@ -46,7 +46,7 @@ finalize_test_case_output () {
46 shift
47 case "$test_case_result" in
48 ok)
49 - set "$*"
49 + set -- "$*"
50 ;;
51 failure)
52 junit_insert="<failure message=\"not ok $test_count -"
@@ -65,17 +65,17 @@ finalize_test_case_output () {
65 junit_insert="$junit_insert<system-err>$(xml_attr_encode \
66 "$(cat "$GIT_TEST_TEE_OUTPUT_FILE")")</system-err>"
67 fi
68 - set "$1" " $junit_insert"
68 + set -- "$1" " $junit_insert"
69 ;;
70 fixed)
71 - set "$* (breakage fixed)"
71 + set -- "$* (breakage fixed)"
72 ;;
73 broken)
74 - set "$* (known breakage)"
74 + set -- "$* (known breakage)"
75 ;;
76 skip)
77 message="$(xml_attr_encode --no-lf "$skipped_reason")"
78 - set "$1" " <skipped message=\"$message\" />"
78 + set -- "$1" " <skipped message=\"$message\" />"
79 ;;
80 esac
81