test: fix for COLUMNS and bash 5

Since c49a177bec (test-lib.sh: set COLUMNS=80 for --verbose repeatability, 2021-06-29) multiple tests have been failing when using bash 5 because checkwinsize is enabled by default, therefore COLUMNS is reset using TIOCGWINSZ even for non-interactive shells. It's debatable whether or not bash should even be doing that, but for now we can avoid this undesirable behavior by disabling this option. Reported-by: Fabian Stelzer <fabian.stelzer@campoint.net> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> [jc: with SZEDER Gábor's suggestion to do this before setting COLUMNS] Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Aug 5, 2021 at 14:48 UTC 390b44eb2bca5195d524629bccc98d8bbee74410
1 file changed +6
t/test-lib.sh
+6
@@ -395,6 +395,12 @@ then
395 verbose=t
396 fi
397
398 +# Since bash 5.0, checkwinsize is enabled by default which does
399 +# update the COLUMNS variable every time a non-builtin command
400 +# completes, even for non-interactive shells.
401 +# Disable that since we are aiming for repeatability.
402 +test -n "$BASH_VERSION" && shopt -u checkwinsize 2>/dev/null
403 +
404 # For repeatability, reset the environment to known value.
405 # TERM is sanitized below, after saving color control sequences.
406 LANG=C