@@ -33,8 +33,10 @@ test_expect_success 'listing all tags in an empty tree should succeed' '
3333'
3434
3535test_expect_success ' listing all tags in an empty tree should output nothing' '
36- test $(git tag -l | wc -l) -eq 0 &&
37- test $(git tag | wc -l) -eq 0
36+ git tag -l >actual &&
37+ test_must_be_empty actual &&
38+ git tag >actual &&
39+ test_must_be_empty actual
3840'
3941
4042test_expect_success ' sort tags, ignore case' '
@@ -178,7 +180,8 @@ test_expect_success 'listing tags using a non-matching pattern should succeed' '
178180'
179181
180182test_expect_success ' listing tags using a non-matching pattern should output nothing' '
181- test $(git tag -l xxx | wc -l) -eq 0
183+ git tag -l xxx >actual &&
184+ test_must_be_empty actual
182185'
183186
184187# special cases for creating tags:
@@ -188,13 +191,15 @@ test_expect_success 'trying to create a tag with the name of one existing should
188191'
189192
190193test_expect_success ' trying to create a tag with a non-valid name should fail' '
191- test $(git tag -l | wc -l) -eq 1 &&
194+ git tag -l >actual &&
195+ test_line_count = 1 actual &&
192196 test_must_fail git tag "" &&
193197 test_must_fail git tag .othertag &&
194198 test_must_fail git tag "other tag" &&
195199 test_must_fail git tag "othertag^" &&
196200 test_must_fail git tag "other~tag" &&
197- test $(git tag -l | wc -l) -eq 1
201+ git tag -l >actual &&
202+ test_line_count = 1 actual
198203'
199204
200205test_expect_success ' creating a tag using HEAD directly should succeed' '
0 commit comments