t7004-tag: use test_config helper
... instead of setting and then manually unsetting configuration variables, on one occasion even outside the test_expect_success block. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor committed
Dec 8, 2016 at 15:23 UTC
9ffda48f53e086895975f2a435afff01c836dad2
1 file changed
+10
-13
t/t7004-tag.sh
+10
-13
@@ -297,11 +297,9 @@ EOF
297
'
298
299
test_expect_success 'listing tags in column with column.*' '
300
- git config column.tag row &&
301
- git config column.ui dense &&
300
+ test_config column.tag row &&
301
+ test_config column.ui dense &&
302
COLUMNS=40 git tag -l >actual &&
303
- git config --unset column.ui &&
304
- git config --unset column.tag &&
303
cat >expected <<\EOF &&
304
a1 aa1 cba t210 t211
305
v0.2.1 v1.0 v1.0.1 v1.1.3
@@ -314,9 +312,8 @@ test_expect_success 'listing tag with -n --column should fail' '
312
'
313
314
test_expect_success 'listing tags -n in column with column.ui ignored' '
317
- git config column.ui "row dense" &&
315
+ test_config column.ui "row dense" &&
316
COLUMNS=40 git tag -l -n >actual &&
319
- git config --unset column.ui &&
317
cat >expected <<\EOF &&
318
a1 Foo
319
aa1 Foo
@@ -1200,11 +1197,10 @@ test_expect_success GPG,RFC1991 \
1197
'
1198
1199
# try to sign with bad user.signingkey
1203
-git config user.signingkey BobTheMouse
1200
test_expect_success GPG \
1201
'git tag -s fails if gpg is misconfigured (bad key)' \
1206
- 'test_must_fail git tag -s -m tail tag-gpg-failure'
1207
-git config --unset user.signingkey
1202
+ 'test_config user.signingkey BobTheMouse &&
1203
+ test_must_fail git tag -s -m tail tag-gpg-failure'
1204
1205
# try to produce invalid signature
1206
test_expect_success GPG \
@@ -1484,7 +1480,7 @@ test_expect_success 'reverse lexical sort' '
1480
'
1481
1482
test_expect_success 'configured lexical sort' '
1487
- git config tag.sort "v:refname" &&
1483
+ test_config tag.sort "v:refname" &&
1484
git tag -l "foo*" >actual &&
1485
cat >expect <<-\EOF &&
1486
foo1.3
@@ -1495,6 +1491,7 @@ test_expect_success 'configured lexical sort' '
1491
'
1492
1493
test_expect_success 'option override configured sort' '
1494
+ test_config tag.sort "v:refname" &&
1495
git tag -l --sort=-refname "foo*" >actual &&
1496
cat >expect <<-\EOF &&
1497
foo1.6
@@ -1509,13 +1506,12 @@ test_expect_success 'invalid sort parameter on command line' '
1506
'
1507
1508
test_expect_success 'invalid sort parameter in configuratoin' '
1512
- git config tag.sort "v:notvalid" &&
1509
+ test_config tag.sort "v:notvalid" &&
1510
test_must_fail git tag -l "foo*"
1511
'
1512
1513
test_expect_success 'version sort with prerelease reordering' '
1517
- git config --unset tag.sort &&
1518
- git config versionsort.prereleaseSuffix -rc &&
1514
+ test_config versionsort.prereleaseSuffix -rc &&
1515
git tag foo1.6-rc1 &&
1516
git tag foo1.6-rc2 &&
1517
git tag -l --sort=version:refname "foo*" >actual &&
@@ -1530,6 +1526,7 @@ test_expect_success 'version sort with prerelease reordering' '
1526
'
1527
1528
test_expect_success 'reverse version sort with prerelease reordering' '
1529
+ test_config versionsort.prereleaseSuffix -rc &&
1530
git tag -l --sort=-version:refname "foo*" >actual &&
1531
cat >expect <<-\EOF &&
1532
foo1.10