Skip to content

Commit 502d87b

Browse files
chriscoolgitster
authored andcommitted
t6050: use test_line_count instead of wc -l
This modernizes a test and makes it more portable. Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeb582a commit 502d87b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t6050-replace.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,11 @@ test_expect_success 'replace ref cleanup' '
393393
'
394394

395395
test_expect_success '--graft with and without already replaced object' '
396-
test $(git log --oneline | wc -l) = 7 &&
396+
git log --oneline >log &&
397+
test_line_count = 7 log &&
397398
git replace --graft $HASH5 &&
398-
test $(git log --oneline | wc -l) = 3 &&
399+
git log --oneline >log &&
400+
test_line_count = 3 log &&
399401
commit_has_parents $HASH5 &&
400402
test_must_fail git replace --graft $HASH5 $HASH4 $HASH3 &&
401403
git replace --force -g $HASH5 $HASH4 $HASH3 &&

0 commit comments

Comments
 (0)