Skip to content

Commit dc9afb6

Browse files
committed
Merge branch 'ps/dash-buggy-0.5.13-workaround'
The way dash 0.5.13 handles non-ASCII contents in here-doc is buggy and breaks our existing tests, which unfortunately have been rewritten to avoid triggering the bug. * ps/dash-buggy-0.5.13-workaround: t9300: work around partial read bug in Dash v0.5.13 t: work around multibyte bug in quoted heredocs with Dash v0.5.13
2 parents ac340a6 + d48c5d5 commit dc9afb6

File tree

7 files changed

+54
-36
lines changed

7 files changed

+54
-36
lines changed

t/t0300-credentials.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,9 @@ test_expect_success 'match percent-encoded values' '
675675
test_expect_success 'match percent-encoded UTF-8 values in path' '
676676
test_config credential.https://example.com.useHttpPath true &&
677677
test_config credential.https://example.com/perú.git.helper "$HELPER" &&
678-
check fill <<-\EOF
678+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
679+
# that contain multibyte chars.
680+
check fill <<-EOF
679681
url=https://example.com/per%C3%BA.git
680682
--
681683
protocol=https

t/t3430-rebase-merges.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,11 @@ test_expect_success 'octopus merges' '
507507
git rebase -i --force-rebase -r HEAD^^ &&
508508
test "Hank" = "$(git show -s --format=%an HEAD)" &&
509509
test "$before" != $(git rev-parse HEAD) &&
510-
test_cmp_graph HEAD^^.. <<-\EOF
510+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
511+
# that contain multibyte chars.
512+
test_cmp_graph HEAD^^.. <<-EOF
511513
*-. Tüntenfüsch
512-
|\ \
514+
|\\ \\
513515
| | * three
514516
| * | two
515517
| |/

t/t3902-quoted.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,18 @@ With SP in it
6060
"\346\277\261\351\207\216\347\264\224"
6161
EOF
6262
63-
cat >expect.raw <<\EOF
63+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
64+
# that contain multibyte chars.
65+
cat >expect.raw <<EOF
6466
Name
65-
"Name and a\nLF"
66-
"Name and an\tHT"
67-
"Name\""
67+
"Name and a\\nLF"
68+
"Name and an\\tHT"
69+
"Name\\""
6870
With SP in it
69-
"濱野\t純"
70-
"濱野\n純"
71+
"濱野\\t純"
72+
"濱野\\n純"
7173
濱野 純
72-
"濱野\"純"
74+
"濱野\\"純"
7375
濱野/file
7476
濱野純
7577
EOF

t/t4014-format-patch.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,9 @@ test_expect_success 'format-patch wraps extremely long from-header (rfc2047)' '
14101410
check_author "Foö Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar"
14111411
'
14121412

1413-
cat >expect <<'EOF'
1413+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1414+
# that contain multibyte chars.
1415+
cat >expect <<EOF
14141416
From: Foö Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar
14151417
Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo
14161418
Bar Foo Bar Foo Bar Foo Bar <author@example.com>
@@ -1425,7 +1427,9 @@ test_expect_success 'format-patch wraps extremely long from-header (non-ASCII wi
14251427
test_cmp expect actual
14261428
'
14271429

1428-
cat >expect <<'EOF'
1430+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1431+
# that contain multibyte chars.
1432+
cat >expect <<EOF
14291433
Subject: [PATCH] Foö
14301434
EOF
14311435
test_expect_success 'subject lines are unencoded with --no-encode-email-headers' '
@@ -1437,7 +1441,9 @@ test_expect_success 'subject lines are unencoded with --no-encode-email-headers'
14371441
test_cmp expect actual
14381442
'
14391443

1440-
cat >expect <<'EOF'
1444+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1445+
# that contain multibyte chars.
1446+
cat >expect <<EOF
14411447
Subject: [PATCH] Foö
14421448
EOF
14431449
test_expect_success 'subject lines are unencoded with format.encodeEmailHeaders=false' '
@@ -1656,7 +1662,9 @@ test_expect_success 'in-body headers trigger content encoding' '
16561662
test_env GIT_AUTHOR_NAME="éxötìc" test_commit exotic &&
16571663
test_when_finished "git reset --hard HEAD^" &&
16581664
git format-patch -1 --stdout --from >patch &&
1659-
cat >expect <<-\EOF &&
1665+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1666+
# that contain multibyte chars.
1667+
cat >expect <<-EOF &&
16601668
From: C O Mitter <committer@example.com>
16611669
Content-Type: text/plain; charset=UTF-8
16621670

t/t4201-shortlog.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ test_expect_success 'output from user-defined format is re-wrapped' '
105105
'
106106

107107
test_expect_success !MINGW,ICONV 'shortlog wrapping' '
108-
cat >expect <<\EOF &&
108+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
109+
# that contain multibyte chars.
110+
cat >expect <<EOF &&
109111
A U Thor (5):
110112
Test
111113
This is a very, very long first line for the commit message to see if

t/t9001-send-email.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,9 @@ test_expect_success $PREREQ 'To headers from files reset each patch' '
16491649
'
16501650

16511651
test_expect_success $PREREQ 'setup expect' '
1652-
cat >email-using-8bit <<\EOF
1652+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1653+
# that contain multibyte chars.
1654+
cat >email-using-8bit <<EOF
16531655
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
16541656
Message-ID: <bogus-message-id@example.com>
16551657
From: author@example.com
@@ -1735,7 +1737,9 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '
17351737
'
17361738

17371739
test_expect_success $PREREQ 'setup expect' '
1738-
cat >email-using-8bit <<-\EOF
1740+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1741+
# that contain multibyte chars.
1742+
cat >email-using-8bit <<-EOF
17391743
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
17401744
Message-ID: <bogus-message-id@example.com>
17411745
From: author@example.com
@@ -1764,7 +1768,9 @@ test_expect_success $PREREQ '--8bit-encoding also treats subject' '
17641768
'
17651769

17661770
test_expect_success $PREREQ 'setup expect' '
1767-
cat >email-using-8bit <<-\EOF
1771+
# NOTE: do not quote this heredoc, Dash 0.5.13 has a bug with heredocs
1772+
# that contain multibyte chars.
1773+
cat >email-using-8bit <<-EOF
17681774
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
17691775
Message-ID: <bogus-message-id@example.com>
17701776
From: A U Thor <author@example.com>

t/t9300-fast-import.sh

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3635,25 +3635,21 @@ background_import_then_checkpoint () {
36353635
echo "progress checkpoint"
36363636
) >&8 &
36373637

3638-
error=1 ;# assume the worst
3639-
while read output <&9
3640-
do
3641-
if test "$output" = "progress checkpoint"
3642-
then
3643-
error=0
3644-
break
3645-
elif test "$output" = "UNEXPECTED"
3646-
then
3647-
break
3648-
fi
3649-
# otherwise ignore cruft
3650-
echo >&2 "cruft: $output"
3651-
done
3638+
last=$(
3639+
while read output <&9
3640+
do
3641+
if test "$output" = "progress checkpoint" || test "$output" = "UNEXPECTED"
3642+
then
3643+
echo "$output"
3644+
break
3645+
else
3646+
# otherwise ignore cruft
3647+
echo >&2 "cruft: $output"
3648+
fi
3649+
done
3650+
)
36523651

3653-
if test $error -eq 1
3654-
then
3655-
false
3656-
fi
3652+
test "$last" = "progress checkpoint"
36573653
}
36583654

36593655
background_import_still_running () {

0 commit comments

Comments
 (0)