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

[PATCH v5 01/16] t0410: remove pipes after git commands

From
Christian Couder <christian.couder@gmail.com>
Date
Apr 9, 2019, 16:11 UTC
Message-ID
<20190409161116.30256-2-chriscool@tuxfamily.org>
In-Reply-To
<20190409161116.30256-1-chriscool@tuxfamily.org>

Let's not run a git command, especially one with "verify" in its name, upstream of a pipe, because the pipe will hide the git command's exit code.

While at it, let's also avoid a useless `cat` command piping into `sed`.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/t0410-partial-clone.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index 5bd892f2f7..3559313bd0 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -166,8 +166,9 @@ test_expect_success 'fetching of missing objects' '
 	# associated packfile contains the object
 	ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
 	test_line_count = 1 promisorlist &&
-	IDX=$(cat promisorlist | sed "s/promisor$/idx/") &&
-	git verify-pack --verbose "$IDX" | grep "$HASH"
+	IDX=$(sed "s/promisor$/idx/" promisorlist) &&
+	git verify-pack --verbose "$IDX" >out &&
+	grep "$HASH" out
 '
 
 test_expect_success 'fetching of missing objects works with ref-in-want enabled' '
@@ -514,8 +515,9 @@ test_expect_success 'fetching of missing objects from an HTTP server' '
 	# associated packfile contains the object
 	ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
 	test_line_count = 1 promisorlist &&
-	IDX=$(cat promisorlist | sed "s/promisor$/idx/") &&
-	git verify-pack --verbose "$IDX" | grep "$HASH"
+	IDX=$(sed "s/promisor$/idx/" promisorlist) &&
+	git verify-pack --verbose "$IDX" >out &&
+	grep "$HASH" out
 '
 
 test_done
-- 
2.21.0.750.g68c8ebb2ac
Previous: Christian CouderNext: Christian Couder
Message 2 of 28 in “Many promisor remotes”
  1. 00/16 Many promisor remotesChristian Couder, Apr 9, 2019
  2. 01/16 t0410: remove pipes after git commandsChristian Couder, Apr 9, 2019
  3. 02/16 fetch-object: make functions return an error codeChristian Couder, Apr 9, 2019
  4. 03/16 Add initial support for many promisor remotesChristian Couder, Apr 9, 2019
  5. 05/16 promisor-remote: add promisor_remote_reinit()Christian Couder, Apr 9, 2019
  6. 06/16 promisor-remote: use repository_format_partial_cloneChristian Couder, Apr 9, 2019
  7. 04/16 promisor-remote: implement promisor_remote_get_direct()Christian Couder, Apr 9, 2019
  8. Derrick StoleeMay 30, 2019
  9. Johannes SchindelinMay 30, 2019
  10. Derrick StoleeMay 30, 2019
  11. Johannes SchindelinMay 31, 2019
  12. Junio C HamanoMay 31, 2019
  13. Christian CouderMay 31, 2019
  14. Christian CouderJun 25, 2019
  15. 07/16 Use promisor_remote_get_direct() and has_promisor_remote()Christian Couder, Apr 9, 2019
  16. 08/16 diff: use promisor-remote.h instead of fetch-object.hChristian Couder, Apr 9, 2019
  17. 09/16 promisor-remote: parse remote.*.partialclonefilterChristian Couder, Apr 9, 2019
  18. 10/16 builtin/fetch: remove unique promisor remote limitationChristian Couder, Apr 9, 2019
  19. 12/16 partial-clone: add multiple remotes in the docChristian Couder, Apr 9, 2019
  20. 11/16 t0410: test fetching from many promisor remotesChristian Couder, Apr 9, 2019
  21. 13/16 remote: add promisor and partial clone config to the docChristian Couder, Apr 9, 2019
  22. 14/16 Remove fetch-object.{c,h} in favor of promisor-remote.{c,h}Christian Couder, Apr 9, 2019
  23. 15/16 Move repository_format_partial_clone to promisor-remote.cChristian Couder, Apr 9, 2019
  24. 16/16 Move core_partial_clone_filter_default to promisor-remote.cChristian Couder, Apr 9, 2019
  25. Junio C HamanoApr 15, 2019
  26. Junio C HamanoApr 15, 2019
  27. Christian CouderApr 15, 2019
  28. Christian CouderApr 15, 2019

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.