Skip to content

Commit db1d63b

Browse files
pks-tgitster
authored andcommitted
t0610: fix non-portable variable assignment
Older versions of the Dash shell fail to parse `local var=val` assignments in some cases when `val` is unquoted. Such failures can be observed e.g. with Ubuntu 20.04 and older, which has a Dash version that still has this bug. Such an assignment has been introduced in t0610. The issue wasn't detected for a while because this test used to only run when the GIT_TEST_DEFAULT_REF_FORMAT environment variable was set to "reftable". We have dropped that requirement now though, meaning that it runs unconditionally, including on jobs which use such older versions of Ubuntu. We have worked around such issues in the past, e.g. in ebee558 (parallel-checkout: avoid dash local bug in tests, 2021-06-06), by quoting the `val` side. Apply the same fix to t0610. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ca13c3e commit db1d63b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t0610-reftable-basics.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ test_expect_success 'init: reinitializing reftable with files backend fails' '
7878
'
7979

8080
test_expect_perms () {
81-
local perms="$1"
82-
local file="$2"
83-
local actual=$(ls -l "$file") &&
81+
local perms="$1" &&
82+
local file="$2" &&
83+
local actual="$(ls -l "$file")" &&
8484

8585
case "$actual" in
8686
$perms*)

0 commit comments

Comments
 (0)