Skip to content

Commit f629333

Browse files
chriscoolgitster
authored andcommitted
t0410: remove pipes after git commands
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 <[email protected]> Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cd2cd41 commit f629333

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

t/t0410-partial-clone.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ test_expect_success 'fetching of missing objects' '
166166
# associated packfile contains the object
167167
ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
168168
test_line_count = 1 promisorlist &&
169-
IDX=$(cat promisorlist | sed "s/promisor$/idx/") &&
170-
git verify-pack --verbose "$IDX" | grep "$HASH"
169+
IDX=$(sed "s/promisor$/idx/" promisorlist) &&
170+
git verify-pack --verbose "$IDX" >out &&
171+
grep "$HASH" out
171172
'
172173

173174
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' '
514515
# associated packfile contains the object
515516
ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
516517
test_line_count = 1 promisorlist &&
517-
IDX=$(cat promisorlist | sed "s/promisor$/idx/") &&
518-
git verify-pack --verbose "$IDX" | grep "$HASH"
518+
IDX=$(sed "s/promisor$/idx/" promisorlist) &&
519+
git verify-pack --verbose "$IDX" >out &&
520+
grep "$HASH" out
519521
'
520522

521523
stop_httpd

0 commit comments

Comments
 (0)