]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5703: feed raw data into test-tool unpack-sideband
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 26 Mar 2020 04:37:38 +0000 (11:37 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Mar 2020 00:30:48 +0000 (17:30 -0700)
busybox's sed isn't binary clean.
Thus, triggers false-negative on this test.

We could replace sed with perl on this usecase.
But, we could slightly modify the helper to discard unwanted data in the
beginning.

Fix the false negative by updating this helper.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-pkt-line.c
t/t5703-upload-pack-ref-in-want.sh

index 282d53638446bb2f0c91b81b313852cbadfb3c1f..12ca698e17a1d556bf345355495849b452b79330 100644 (file)
@@ -67,7 +67,7 @@ static void unpack_sideband(void)
                case PACKET_READ_NORMAL:
                        band = reader.line[0] & 0xff;
                        if (band < 1 || band > 2)
-                               die("unexpected side band %d", band);
+                               continue; /* skip non-sideband packets */
                        fd = band;
 
                        write_or_die(fd, reader.line + 1, reader.pktlen - 1);
index 7fba3063bf9150687df4bcbd56cdfecf50c8e289..a34460f7d82ea0ce894dab17ad3b6a7f7765b408 100755 (executable)
@@ -13,10 +13,7 @@ get_actual_refs () {
 }
 
 get_actual_commits () {
-       sed -n -e '/packfile/,/0000/{
-               /packfile/d
-               p
-               }' <out | test-tool pkt-line unpack-sideband >o.pack &&
+       test-tool pkt-line unpack-sideband <out >o.pack &&
        git index-pack o.pack &&
        git verify-pack -v o.idx >objs &&
        grep commit objs | cut -d" " -f1 | sort >actual_commits