Skip to content

Commit e283548

Browse files
committed
Merge branch 'jk/config-test-cleanup'
* jk/config-test-cleanup: t1300: attempting to remove a non-existent .git/config is not an error
2 parents aadf863 + 795290e commit e283548

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

t/t1300-repo-config.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,6 @@ EOF
558558
test_expect_success "section was removed properly" \
559559
"test_cmp expect .git/config"
560560

561-
rm .git/config
562-
563561
cat > expect << EOF
564562
[gitcvs]
565563
enabled = true
@@ -570,6 +568,7 @@ EOF
570568

571569
test_expect_success 'section ending' '
572570
571+
rm -f .git/config &&
573572
git config gitcvs.enabled true &&
574573
git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
575574
git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
@@ -642,8 +641,6 @@ test_expect_success 'invalid bool (set)' '
642641
643642
test_must_fail git config --bool bool.nobool foobar'
644643

645-
rm .git/config
646-
647644
cat > expect <<\EOF
648645
[bool]
649646
true1 = true
@@ -658,6 +655,7 @@ EOF
658655

659656
test_expect_success 'set --bool' '
660657
658+
rm -f .git/config &&
661659
git config --bool bool.true1 01 &&
662660
git config --bool bool.true2 -1 &&
663661
git config --bool bool.true3 YeS &&
@@ -668,8 +666,6 @@ test_expect_success 'set --bool' '
668666
git config --bool bool.false4 FALSE &&
669667
cmp expect .git/config'
670668

671-
rm .git/config
672-
673669
cat > expect <<\EOF
674670
[int]
675671
val1 = 1
@@ -679,13 +675,12 @@ EOF
679675

680676
test_expect_success 'set --int' '
681677
678+
rm -f .git/config &&
682679
git config --int int.val1 01 &&
683680
git config --int int.val2 -1 &&
684681
git config --int int.val3 5m &&
685682
cmp expect .git/config'
686683

687-
rm .git/config
688-
689684
cat >expect <<\EOF
690685
[bool]
691686
true1 = true
@@ -699,6 +694,7 @@ cat >expect <<\EOF
699694
EOF
700695

701696
test_expect_success 'get --bool-or-int' '
697+
rm -f .git/config &&
702698
(
703699
echo "[bool]"
704700
echo true1
@@ -718,7 +714,6 @@ test_expect_success 'get --bool-or-int' '
718714
719715
'
720716

721-
rm .git/config
722717
cat >expect <<\EOF
723718
[bool]
724719
true1 = true
@@ -732,6 +727,7 @@ cat >expect <<\EOF
732727
EOF
733728

734729
test_expect_success 'set --bool-or-int' '
730+
rm -f .git/config &&
735731
git config --bool-or-int bool.true1 true &&
736732
git config --bool-or-int bool.false1 false &&
737733
git config --bool-or-int bool.true2 yes &&
@@ -742,8 +738,6 @@ test_expect_success 'set --bool-or-int' '
742738
test_cmp expect .git/config
743739
'
744740

745-
rm .git/config
746-
747741
cat >expect <<\EOF
748742
[path]
749743
home = ~/
@@ -752,6 +746,7 @@ cat >expect <<\EOF
752746
EOF
753747

754748
test_expect_success NOT_MINGW 'set --path' '
749+
rm -f .git/config &&
755750
git config --path path.home "~/" &&
756751
git config --path path.normal "/dev/null" &&
757752
git config --path path.trailingtilde "foo~" &&
@@ -800,7 +795,7 @@ cat > expect << EOF
800795
hash = "test#test"
801796
EOF
802797
test_expect_success 'quoting' '
803-
rm .git/config &&
798+
rm -f .git/config &&
804799
git config quote.leading " test" &&
805800
git config quote.ending "test " &&
806801
git config quote.semicolon "test;test" &&

0 commit comments

Comments
 (0)