aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-04-12 06:44:53 +0200
committerJunio C Hamano <gitster@pobox.com>2024-04-12 08:47:51 -0700
commitdb1d63bf57b49d71b7327f36740430525d7049b0 (patch)
treea46e838ffa3b592fae38b81177c1401f4703d66a
parentca13c3e94a737b3dc8624e433ed87fead3a8b974 (diff)
downloadgit-db1d63bf57b49d71b7327f36740430525d7049b0.tar.gz
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 ebee5580ca (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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t0610-reftable-basics.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh
index aa9282007c..dfa7e274ea 100755
--- a/t/t0610-reftable-basics.sh
+++ b/t/t0610-reftable-basics.sh
@@ -78,9 +78,9 @@ test_expect_success 'init: reinitializing reftable with files backend fails' '
'
test_expect_perms () {
- local perms="$1"
- local file="$2"
- local actual=$(ls -l "$file") &&
+ local perms="$1" &&
+ local file="$2" &&
+ local actual="$(ls -l "$file")" &&
case "$actual" in
$perms*)