diff options
author | Jiang Xin <zhiyou.jx@alibaba-inc.com> | 2023-12-17 17:41:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-12-19 00:24:38 +0300 |
commit | 7033d5479b8a7b8e7c33892f23d106c33c938ff4 (patch) | |
tree | 8811ec4e4e82bc73dee4a5af02109a0a5ff21573 /t/t0070-fundamental.sh | |
parent | 64220dc5f7450d8eca471fa484965b1dcddc2827 (diff) |
pkt-line: do not chomp newlines for sideband messages
When calling "packet_read_with_status()" to parse pkt-line encoded
packets, we can turn on the flag "PACKET_READ_CHOMP_NEWLINE" to chomp
newline character for each packet for better line matching. But when
receiving data and progress information using sideband, we should turn
off the flag "PACKET_READ_CHOMP_NEWLINE" to prevent mangling newline
characters from data and progress information.
When both the server and the client support "sideband-all" capability,
we have a dilemma that newline characters in negotiation packets should
be removed, but the newline characters in the progress information
should be left intact.
Add new flag "PACKET_READ_USE_SIDEBAND" for "packet_read_with_status()"
to prevent mangling newline characters in sideband messages.
Helped-by: Jonathan Tan <jonathantanmy@google.com>
Helped-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0070-fundamental.sh')
-rwxr-xr-x | t/t0070-fundamental.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh index 275edbf6e7..0d2b7d8d93 100755 --- a/t/t0070-fundamental.sh +++ b/t/t0070-fundamental.sh @@ -97,7 +97,7 @@ test_expect_success 'unpack-sideband: packet_reader_read() consumes sideband, no test_cmp expect-err err ' -test_expect_failure 'unpack-sideband: packet_reader_read() consumes sideband, chomp payload' ' +test_expect_success 'unpack-sideband: packet_reader_read() consumes sideband, chomp payload' ' test_when_finished "rm -f expect-out expect-err" && test-tool pkt-line send-split-sideband >split-sideband && test-tool pkt-line unpack-sideband \ |