diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-04-02 08:51:18 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-02 11:39:42 -0700 |
| commit | 0c8424c259b417c6aadc23f5398e55edd7b047a2 (patch) | |
| tree | 4ac6377887b49a395f1aee238400d2f6088de944 /tools/generate-python.sh | |
| parent | 67ad42147a7acc2af6074753ebd03d904476118f (diff) | |
| download | git-0c8424c259b417c6aadc23f5398e55edd7b047a2.tar.xz | |
t: work around multibyte bug in quoted heredocs with Dash v0.5.13
When executing our test suite with Dash v0.5.13.2 one can observe
several test failures that all have the same symptoms: we have a quoted
heredoc that contains multibyte characters, but the final data does not
match what we actually wanted to write. One such example is in t0300,
where we see the diffs like the following:
--- expect-stdout 2026-04-01 07:25:45.249919440 +0000
+++ stdout 2026-04-01 07:25:45.254919509 +0000
@@ -1,5 +1,5 @@
protocol=https
host=example.com
-path=perĂº.git
+path=perĂº.git
username=foo
password=bar
While seemingly the same, the data that we've written via the heredoc
contains some invisible bytes. The expected hex representation of the
string is:
7065 72c3 ba2e 6769 74 per...git
But what we actually get instead is this string:
7065 7285 02c3 ba02 852e 6769 74 per.......git
What's important to note here is that the multibyte character exists in
both versions. But in the broken version we see that the bytes are
wrapped in a sequence of "85 02" and "02 85". This is the CTLMBCHAR byte
sequence of Dash, which it uses internally to quote multibyte sequences.
As it turns out, this bug was introduced in c5bf970 (expand: Add
multi-byte support to pmatch, 2024-06-02), which adds multibyte support
to more contexts of Dash. One of these contexts seems to be in heredocs,
and Dash _does_ correctly unquote these multibyte sequences when using
an unquoted heredoc. But the bug seems to be that this unquoting does
not happen in quoted heredocs, and the bug still exists on the latest
"master" branch.
For now, work around the bug by using unquoted heredocs instead.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tools/generate-python.sh')
0 files changed, 0 insertions, 0 deletions
