Skip to content

Commit 9ffda48

Browse files
szedergitster
authored andcommitted
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>
1 parent eba286e commit 9ffda48

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

t/t7004-tag.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,9 @@ EOF
297297
'
298298

299299
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 &&
302302
COLUMNS=40 git tag -l >actual &&
303-
git config --unset column.ui &&
304-
git config --unset column.tag &&
305303
cat >expected <<\EOF &&
306304
a1 aa1 cba t210 t211
307305
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' '
314312
'
315313

316314
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" &&
318316
COLUMNS=40 git tag -l -n >actual &&
319-
git config --unset column.ui &&
320317
cat >expected <<\EOF &&
321318
a1 Foo
322319
aa1 Foo
@@ -1200,11 +1197,10 @@ test_expect_success GPG,RFC1991 \
12001197
'
12011198

12021199
# try to sign with bad user.signingkey
1203-
git config user.signingkey BobTheMouse
12041200
test_expect_success GPG \
12051201
'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'
12081204

12091205
# try to produce invalid signature
12101206
test_expect_success GPG \
@@ -1484,7 +1480,7 @@ test_expect_success 'reverse lexical sort' '
14841480
'
14851481

14861482
test_expect_success 'configured lexical sort' '
1487-
git config tag.sort "v:refname" &&
1483+
test_config tag.sort "v:refname" &&
14881484
git tag -l "foo*" >actual &&
14891485
cat >expect <<-\EOF &&
14901486
foo1.3
@@ -1495,6 +1491,7 @@ test_expect_success 'configured lexical sort' '
14951491
'
14961492

14971493
test_expect_success 'option override configured sort' '
1494+
test_config tag.sort "v:refname" &&
14981495
git tag -l --sort=-refname "foo*" >actual &&
14991496
cat >expect <<-\EOF &&
15001497
foo1.6
@@ -1509,13 +1506,12 @@ test_expect_success 'invalid sort parameter on command line' '
15091506
'
15101507

15111508
test_expect_success 'invalid sort parameter in configuratoin' '
1512-
git config tag.sort "v:notvalid" &&
1509+
test_config tag.sort "v:notvalid" &&
15131510
test_must_fail git tag -l "foo*"
15141511
'
15151512

15161513
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 &&
15191515
git tag foo1.6-rc1 &&
15201516
git tag foo1.6-rc2 &&
15211517
git tag -l --sort=version:refname "foo*" >actual &&
@@ -1530,6 +1526,7 @@ test_expect_success 'version sort with prerelease reordering' '
15301526
'
15311527

15321528
test_expect_success 'reverse version sort with prerelease reordering' '
1529+
test_config versionsort.prereleaseSuffix -rc &&
15331530
git tag -l --sort=-version:refname "foo*" >actual &&
15341531
cat >expect <<-\EOF &&
15351532
foo1.10

0 commit comments

Comments
 (0)