@@ -61,8 +61,9 @@ test_expect_success 'sort tags, ignore case' '
61
61
)
62
62
'
63
63
64
- test_expect_success ' looking for a tag in an empty tree should fail' \
65
- ' ! (tag_exists mytag)'
64
+ test_expect_success ' looking for a tag in an empty tree should fail' '
65
+ ! (tag_exists mytag)
66
+ '
66
67
67
68
test_expect_success ' creating a tag in an empty tree should fail' '
68
69
test_must_fail git tag mynotag &&
@@ -148,25 +149,31 @@ test_expect_success 'listing all tags if one exists should output that tag' '
148
149
149
150
# pattern matching:
150
151
151
- test_expect_success ' listing a tag using a matching pattern should succeed' \
152
- ' git tag -l mytag'
152
+ test_expect_success ' listing a tag using a matching pattern should succeed' '
153
+ git tag -l mytag
154
+ '
153
155
154
- test_expect_success ' listing a tag with --ignore-case' \
155
- ' test $(git tag -l --ignore-case MYTAG) = mytag'
156
+ test_expect_success ' listing a tag with --ignore-case' '
157
+ test $(git tag -l --ignore-case MYTAG) = mytag
158
+ '
156
159
157
- test_expect_success ' listing a tag using a matching pattern should output that tag' \
158
- ' test $(git tag -l mytag) = mytag'
160
+ test_expect_success ' listing a tag using a matching pattern should output that tag' '
161
+ test $(git tag -l mytag) = mytag
162
+ '
159
163
160
- test_expect_success ' listing tags using a non-matching pattern should succeed' \
161
- ' git tag -l xxx'
164
+ test_expect_success ' listing tags using a non-matching pattern should succeed' '
165
+ git tag -l xxx
166
+ '
162
167
163
- test_expect_success ' listing tags using a non-matching pattern should output nothing' \
164
- ' test $(git tag -l xxx | wc -l) -eq 0'
168
+ test_expect_success ' listing tags using a non-matching pattern should output nothing' '
169
+ test $(git tag -l xxx | wc -l) -eq 0
170
+ '
165
171
166
172
# special cases for creating tags:
167
173
168
- test_expect_success ' trying to create a tag with the name of one existing should fail' \
169
- ' test_must_fail git tag mytag'
174
+ test_expect_success ' trying to create a tag with the name of one existing should fail' '
175
+ test_must_fail git tag mytag
176
+ '
170
177
171
178
test_expect_success ' trying to create a tag with a non-valid name should fail' '
172
179
test $(git tag -l | wc -l) -eq 1 &&
@@ -236,8 +243,9 @@ test_expect_success 'trying to delete two tags, existing and not, should fail in
236
243
! tag_exists nonexistingtag
237
244
'
238
245
239
- test_expect_success ' trying to delete an already deleted tag should fail' \
240
- ' test_must_fail git tag -d mytag'
246
+ test_expect_success ' trying to delete an already deleted tag should fail' '
247
+ test_must_fail git tag -d mytag
248
+ '
241
249
242
250
# listing various tags with pattern matching:
243
251
@@ -417,14 +425,17 @@ test_expect_success 'a non-annotated tag created without parameters should point
417
425
test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD)
418
426
'
419
427
420
- test_expect_success ' trying to verify an unknown tag should fail' \
421
- ' test_must_fail git tag -v unknown-tag'
428
+ test_expect_success ' trying to verify an unknown tag should fail' '
429
+ test_must_fail git tag -v unknown-tag
430
+ '
422
431
423
- test_expect_success ' trying to verify a non-annotated and non-signed tag should fail' \
424
- ' test_must_fail git tag -v non-annotated-tag'
432
+ test_expect_success ' trying to verify a non-annotated and non-signed tag should fail' '
433
+ test_must_fail git tag -v non-annotated-tag
434
+ '
425
435
426
- test_expect_success ' trying to verify many non-annotated or unknown tags, should fail' \
427
- ' test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2'
436
+ test_expect_success ' trying to verify many non-annotated or unknown tags, should fail' '
437
+ test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2
438
+ '
428
439
429
440
# creating annotated tags:
430
441
@@ -1014,8 +1025,8 @@ test_expect_success GPG '-s implies annotated tag' '
1014
1025
test_cmp expect actual
1015
1026
'
1016
1027
1017
- test_expect_success GPG ' git tag -s implied if configured with tag.forcesignannotated' \
1018
- ' get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&
1028
+ test_expect_success GPG ' git tag -s implied if configured with tag.forcesignannotated' '
1029
+ get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&
1019
1030
echo "A message" >>expect &&
1020
1031
echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
1021
1032
test_config tag.forcesignannotated true &&
@@ -1024,15 +1035,15 @@ test_expect_success GPG 'git tag -s implied if configured with tag.forcesignanno
1024
1035
test_cmp expect actual
1025
1036
'
1026
1037
1027
- test_expect_success GPG ' lightweight with no message when configured with tag.forcesignannotated' \
1028
- ' test_config tag.forcesignannotated true &&
1038
+ test_expect_success GPG ' lightweight with no message when configured with tag.forcesignannotated' '
1039
+ test_config tag.forcesignannotated true &&
1029
1040
git tag forcesignannotated-lightweight &&
1030
1041
tag_exists forcesignannotated-lightweight &&
1031
1042
test_must_fail git tag -v forcesignannotated-no-message
1032
1043
'
1033
1044
1034
- test_expect_success GPG ' git tag -a disable configured tag.forcesignannotated' \
1035
- ' get_tag_header forcesignannotated-annotate $commit commit $time >expect &&
1045
+ test_expect_success GPG ' git tag -a disable configured tag.forcesignannotated' '
1046
+ get_tag_header forcesignannotated-annotate $commit commit $time >expect &&
1036
1047
echo "A message" >>expect &&
1037
1048
test_config tag.forcesignannotated true &&
1038
1049
git tag -a -m "A message" forcesignannotated-annotate &&
@@ -1041,8 +1052,8 @@ test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \
1041
1052
test_must_fail git tag -v forcesignannotated-annotate
1042
1053
'
1043
1054
1044
- test_expect_success GPG ' git tag --sign enable GPG sign' \
1045
- ' get_tag_header forcesignannotated-disabled $commit commit $time >expect &&
1055
+ test_expect_success GPG ' git tag --sign enable GPG sign' '
1056
+ get_tag_header forcesignannotated-disabled $commit commit $time >expect &&
1046
1057
echo "A message" >>expect &&
1047
1058
echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
1048
1059
test_config tag.forcesignannotated false &&
@@ -1051,8 +1062,8 @@ test_expect_success GPG 'git tag --sign enable GPG sign' \
1051
1062
test_cmp expect actual
1052
1063
'
1053
1064
1054
- test_expect_success GPG ' git tag configured tag.gpgsign enables GPG sign' \
1055
- ' get_tag_header gpgsign-enabled $commit commit $time >expect &&
1065
+ test_expect_success GPG ' git tag configured tag.gpgsign enables GPG sign' '
1066
+ get_tag_header gpgsign-enabled $commit commit $time >expect &&
1056
1067
echo "A message" >>expect &&
1057
1068
echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
1058
1069
test_config tag.gpgsign true &&
@@ -1061,8 +1072,8 @@ test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \
1061
1072
test_cmp expect actual
1062
1073
'
1063
1074
1064
- test_expect_success GPG ' git tag --no-sign configured tag.gpgsign skip GPG sign' \
1065
- ' get_tag_header no-sign $commit commit $time >expect &&
1075
+ test_expect_success GPG ' git tag --no-sign configured tag.gpgsign skip GPG sign' '
1076
+ get_tag_header no-sign $commit commit $time >expect &&
1066
1077
echo "A message" >>expect &&
1067
1078
test_config tag.gpgsign true &&
1068
1079
git tag -a --no-sign -m "A message" no-sign &&
@@ -1077,11 +1088,13 @@ test_expect_success GPG 'trying to create a signed tag with non-existing -F file
1077
1088
! tag_exists nosigtag
1078
1089
'
1079
1090
1080
- test_expect_success GPG ' verifying a signed tag should succeed' \
1081
- ' git tag -v signed-tag'
1091
+ test_expect_success GPG ' verifying a signed tag should succeed' '
1092
+ git tag -v signed-tag
1093
+ '
1082
1094
1083
- test_expect_success GPG ' verifying two signed tags in one command should succeed' \
1084
- ' git tag -v signed-tag file-signed-tag'
1095
+ test_expect_success GPG ' verifying two signed tags in one command should succeed' '
1096
+ git tag -v signed-tag file-signed-tag
1097
+ '
1085
1098
1086
1099
test_expect_success GPG ' verifying many signed and non-signed tags should fail' '
1087
1100
test_must_fail git tag -v signed-tag annotated-tag &&
@@ -1451,14 +1464,16 @@ test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '
1451
1464
'
1452
1465
1453
1466
# try to sign with bad user.signingkey
1454
- test_expect_success GPG ' git tag -s fails if gpg is misconfigured (bad key)' \
1455
- ' test_config user.signingkey BobTheMouse &&
1456
- test_must_fail git tag -s -m tail tag-gpg-failure'
1467
+ test_expect_success GPG ' git tag -s fails if gpg is misconfigured (bad key)' '
1468
+ test_config user.signingkey BobTheMouse &&
1469
+ test_must_fail git tag -s -m tail tag-gpg-failure
1470
+ '
1457
1471
1458
1472
# try to produce invalid signature
1459
- test_expect_success GPG ' git tag -s fails if gpg is misconfigured (bad signature format)' \
1460
- ' test_config gpg.program echo &&
1461
- test_must_fail git tag -s -m tail tag-gpg-failure'
1473
+ test_expect_success GPG ' git tag -s fails if gpg is misconfigured (bad signature format)' '
1474
+ test_config gpg.program echo &&
1475
+ test_must_fail git tag -s -m tail tag-gpg-failure
1476
+ '
1462
1477
1463
1478
# try to produce invalid signature
1464
1479
test_expect_success GPG ' git verifies tag is valid with double signature' '
@@ -1479,21 +1494,23 @@ test_expect_success GPG 'git verifies tag is valid with double signature' '
1479
1494
'
1480
1495
1481
1496
# try to sign with bad user.signingkey
1482
- test_expect_success GPGSM ' git tag -s fails if gpgsm is misconfigured (bad key)' \
1483
- ' test_config user.signingkey BobTheMouse &&
1484
- test_config gpg.format x509 &&
1485
- test_must_fail git tag -s -m tail tag-gpg-failure'
1497
+ test_expect_success GPGSM ' git tag -s fails if gpgsm is misconfigured (bad key)' '
1498
+ test_config user.signingkey BobTheMouse &&
1499
+ test_config gpg.format x509 &&
1500
+ test_must_fail git tag -s -m tail tag-gpg-failure
1501
+ '
1486
1502
1487
1503
# try to produce invalid signature
1488
- test_expect_success GPGSM ' git tag -s fails if gpgsm is misconfigured (bad signature format)' \
1489
- ' test_config gpg.x509.program echo &&
1490
- test_config gpg.format x509 &&
1491
- test_must_fail git tag -s -m tail tag-gpg-failure'
1504
+ test_expect_success GPGSM ' git tag -s fails if gpgsm is misconfigured (bad signature format)' '
1505
+ test_config gpg.x509.program echo &&
1506
+ test_config gpg.format x509 &&
1507
+ test_must_fail git tag -s -m tail tag-gpg-failure
1508
+ '
1492
1509
1493
1510
# try to verify without gpg:
1494
1511
1495
- test_expect_success GPG ' verify signed tag fails when public key is not present' \
1496
- ' rm -rf gpghome &&
1512
+ test_expect_success GPG ' verify signed tag fails when public key is not present' '
1513
+ rm -rf gpghome &&
1497
1514
test_must_fail git tag -v signed-tag
1498
1515
'
1499
1516
0 commit comments