summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-07-28 20:18:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-28 20:18:00 (GMT)
commit5bae9272220ce25d170e35c3cb84bcc110685363 (patch)
tree1b3b5b8f41e70f7927fe51369b899aefad9f9bda /t/helper
parent4d4c8ddd37cc310fce20e5d26f0f4716070ba172 (diff)
parent64f0109f17ecfdd504f497b67cc066b672e00dc5 (diff)
downloadgit-5bae9272220ce25d170e35c3cb84bcc110685363.zip
git-5bae9272220ce25d170e35c3cb84bcc110685363.tar.gz
git-5bae9272220ce25d170e35c3cb84bcc110685363.tar.bz2
Merge branch 'ab/pkt-line-tests'
Tests that cover protocol bits have been updated and helpers used there have been consolidated. * ab/pkt-line-tests: test-lib-functions: use test-tool for [de]packetize()
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-pkt-line.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/helper/test-pkt-line.c b/t/helper/test-pkt-line.c
index 5e638f0..c5e052e 100644
--- a/t/helper/test-pkt-line.c
+++ b/t/helper/test-pkt-line.c
@@ -26,6 +26,16 @@ static void pack(int argc, const char **argv)
}
}
+static void pack_raw_stdin(void)
+{
+ struct strbuf sb = STRBUF_INIT;
+
+ if (strbuf_read(&sb, 0, 0) < 0)
+ die_errno("failed to read from stdin");
+ packet_write(1, sb.buf, sb.len);
+ strbuf_release(&sb);
+}
+
static void unpack(void)
{
struct packet_reader reader;
@@ -110,6 +120,8 @@ int cmd__pkt_line(int argc, const char **argv)
if (!strcmp(argv[1], "pack"))
pack(argc - 2, argv + 2);
+ else if (!strcmp(argv[1], "pack-raw-stdin"))
+ pack_raw_stdin();
else if (!strcmp(argv[1], "unpack"))
unpack();
else if (!strcmp(argv[1], "unpack-sideband"))