git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 8/8] t5703: feed raw data into test-tool unpack-sideband

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Mar 22, 2020, 00:55 UTC
Message-ID
<d4507d381e739667f9059fe2b512fb251a74c500.1584838148.git.congdanhqx@gmail.com>
In-Reply-To
<cover.1584838148.git.congdanhqx@gmail.com>

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>
---
 t/helper/test-pkt-line.c           | 2 +-
 t/t5703-upload-pack-ref-in-want.sh | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/t/helper/test-pkt-line.c b/t/helper/test-pkt-line.c
index 282d536384..12ca698e17 100644
--- a/t/helper/test-pkt-line.c
+++ b/t/helper/test-pkt-line.c
@@ -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);
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 7fba3063bf..a34460f7d8 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -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
-- 
2.26.0.rc2.310.g2932bb562d
Previous: Johannes SchindelinNext: Jeff King
Message 25 of 36 in “fix test failure with busybox”
  1. 0/8 fix test failure with busyboxĐoàn Trần Công Danh, Mar 22, 2020
  2. 1/8 t4061: use POSIX compliant regex(7)Đoàn Trần Công Danh, Mar 22, 2020
  3. 3/8 t5003: drop the subshell in test_lazy_prereqĐoàn Trần Công Danh, Mar 22, 2020
  4. 2/8 test-lib-functions: test_cmp: eval $GIT_TEST_CMPĐoàn Trần Công Danh, Mar 22, 2020
  5. 4/8 t5003: skip conversion test if unzip -a is unavailableĐoàn Trần Công Danh, Mar 22, 2020
  6. 5/8 t5616: use rev-parse instead to get HEAD's object_idĐoàn Trần Công Danh, Mar 22, 2020
  7. 6/8 t7063: drop non-POSIX argument "-ls" from find(1)Đoàn Trần Công Danh, Mar 22, 2020
  8. Johannes SchindelinMar 23, 2020
  9. Torsten BögershausenMar 23, 2020
  10. Danh DoanMar 23, 2020
  11. Junio C HamanoMar 23, 2020
  12. Junio C HamanoMar 23, 2020
  13. Johannes SchindelinMar 24, 2020
  14. Junio C HamanoMar 24, 2020
  15. 7/8 t4124: fix test for non-compliant diff(1)Đoàn Trần Công Danh, Mar 22, 2020
  16. Johannes SchindelinMar 23, 2020
  17. Danh DoanMar 23, 2020
  18. Junio C HamanoMar 23, 2020
  19. Danh DoanMar 24, 2020
  20. Junio C HamanoMar 24, 2020
  21. Danh DoanMar 25, 2020
  22. Johannes SchindelinMar 24, 2020
  23. Junio C HamanoMar 24, 2020
  24. Johannes SchindelinMar 25, 2020
  25. 8/8 t5703: feed raw data into test-tool unpack-sidebandĐoàn Trần Công Danh, Mar 22, 2020
  26. Jeff KingMar 22, 2020
  27. 0/8 fix test failure with busyboxĐoàn Trần Công Danh, Mar 26, 2020
  28. 1/8 t4061: use POSIX compliant regex(7)Đoàn Trần Công Danh, Mar 26, 2020
  29. 2/8 test-lib-functions: test_cmp: eval $GIT_TEST_CMPĐoàn Trần Công Danh, Mar 26, 2020
  30. 3/8 t5003: drop the subshell in test_lazy_prereqĐoàn Trần Công Danh, Mar 26, 2020
  31. 4/8 t5003: skip conversion test if unzip -a is unavailableĐoàn Trần Công Danh, Mar 26, 2020
  32. 5/8 t5616: use rev-parse instead to get HEAD's object_idĐoàn Trần Công Danh, Mar 26, 2020
  33. 7/8 t4124: fix test for non-compliant diff(1)Đoàn Trần Công Danh, Mar 26, 2020
  34. Junio C HamanoMar 27, 2020
  35. 6/8 t7063: drop non-POSIX argument "-ls" from find(1)Đoàn Trần Công Danh, Mar 26, 2020
  36. 8/8 t5703: feed raw data into test-tool unpack-sidebandĐoàn Trần Công Danh, Mar 26, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.