Skip to content

Commit 84370e3

Browse files
sgngitster
authored andcommitted
t5703: feed raw data into test-tool unpack-sideband
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 <[email protected]> Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f73533a commit 84370e3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

t/helper/test-pkt-line.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void unpack_sideband(void)
6767
case PACKET_READ_NORMAL:
6868
band = reader.line[0] & 0xff;
6969
if (band < 1 || band > 2)
70-
die("unexpected side band %d", band);
70+
continue; /* skip non-sideband packets */
7171
fd = band;
7272

7373
write_or_die(fd, reader.line + 1, reader.pktlen - 1);

t/t5703-upload-pack-ref-in-want.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ get_actual_refs () {
1313
}
1414

1515
get_actual_commits () {
16-
sed -n -e '/packfile/,/0000/{
17-
/packfile/d
18-
p
19-
}' <out | test-tool pkt-line unpack-sideband >o.pack &&
16+
test-tool pkt-line unpack-sideband <out >o.pack &&
2017
git index-pack o.pack &&
2118
git verify-pack -v o.idx >objs &&
2219
grep commit objs | cut -d" " -f1 | sort >actual_commits

0 commit comments

Comments
 (0)