Skip to content

Commit a6fefa6

Browse files
pks-tgitster
authored andcommitted
ci/lib: use echo instead of printf to set up sections
We use printf to set up sections with GitLab CI even though we could trivially use echo. This may cause problems in case the argument passed to `begin_group ()` or `end_group ()` contains formatting directives as we use them as part of the formatting string. Simplify the code to instead use echo. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ca1b3bf commit a6fefa6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ci/lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ elif test true = "$GITLAB_CI"
1818
then
1919
begin_group () {
2020
need_to_end_group=t
21-
printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n"
21+
echo "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1"
2222
trap "end_group '$1'" EXIT
2323
set -x
2424
}
@@ -27,7 +27,7 @@ then
2727
test -n "$need_to_end_group" || return 0
2828
set +x
2929
need_to_end_group=
30-
printf "\e[0Ksection_end:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K\n"
30+
echo "\e[0Ksection_end:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K"
3131
trap - EXIT
3232
}
3333
else

0 commit comments

Comments
 (0)