Code

Merge branch 'jk/config-test-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Wed, 19 Oct 2011 17:47:59 +0000 (10:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Oct 2011 17:47:59 +0000 (10:47 -0700)
* jk/config-test-cleanup:
  t1300: attempting to remove a non-existent .git/config is not an error

1  2 
t/t1300-repo-config.sh

diff --combined t/t1300-repo-config.sh
index fba5ae0d18232f218474e34def256477726ca895,39e2244c1ff48f3a7929ba321484826428ce39ac..51caff047b0da1a6d1df7fa651b3a8c31e8ae3e2
@@@ -365,12 -365,6 +365,12 @@@ test_expect_success 'get-regexp variabl
        'git config --get-regexp novalue > output &&
         cmp output expect'
  
 +echo 'novalue.variable true' > expect
 +
 +test_expect_success 'get-regexp --bool variable with no value' \
 +      'git config --bool --get-regexp novalue > output &&
 +       cmp output expect'
 +
  echo 'emptyvalue.variable ' > expect
  
  test_expect_success 'get-regexp variable with empty value' \
@@@ -558,8 -552,6 +558,6 @@@ EO
  test_expect_success "section was removed properly" \
        "test_cmp expect .git/config"
  
- rm .git/config
  cat > expect << EOF
  [gitcvs]
        enabled = true
@@@ -570,6 -562,7 +568,7 @@@ EO
  
  test_expect_success 'section ending' '
  
+       rm -f .git/config &&
        git config gitcvs.enabled true &&
        git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
        git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
@@@ -642,8 -635,6 +641,6 @@@ test_expect_success 'invalid bool (set)
  
        test_must_fail git config --bool bool.nobool foobar'
  
- rm .git/config
  cat > expect <<\EOF
  [bool]
        true1 = true
@@@ -658,6 -649,7 +655,7 @@@ EO
  
  test_expect_success 'set --bool' '
  
+       rm -f .git/config &&
        git config --bool bool.true1 01 &&
        git config --bool bool.true2 -1 &&
        git config --bool bool.true3 YeS &&
        git config --bool bool.false4 FALSE &&
        cmp expect .git/config'
  
- rm .git/config
  cat > expect <<\EOF
  [int]
        val1 = 1
@@@ -679,13 -669,12 +675,12 @@@ EO
  
  test_expect_success 'set --int' '
  
+       rm -f .git/config &&
        git config --int int.val1 01 &&
        git config --int int.val2 -1 &&
        git config --int int.val3 5m &&
        cmp expect .git/config'
  
- rm .git/config
  cat >expect <<\EOF
  [bool]
        true1 = true
  EOF
  
  test_expect_success 'get --bool-or-int' '
+       rm -f .git/config &&
        (
                echo "[bool]"
                echo true1
  
  '
  
- rm .git/config
  cat >expect <<\EOF
  [bool]
        true1 = true
  EOF
  
  test_expect_success 'set --bool-or-int' '
+       rm -f .git/config &&
        git config --bool-or-int bool.true1 true &&
        git config --bool-or-int bool.false1 false &&
        git config --bool-or-int bool.true2 yes &&
        test_cmp expect .git/config
  '
  
- rm .git/config
  cat >expect <<\EOF
  [path]
        home = ~/
  EOF
  
  test_expect_success NOT_MINGW 'set --path' '
+       rm -f .git/config &&
        git config --path path.home "~/" &&
        git config --path path.normal "/dev/null" &&
        git config --path path.trailingtilde "foo~" &&
@@@ -800,7 -789,7 +795,7 @@@ cat > expect << EO
        hash = "test#test"
  EOF
  test_expect_success 'quoting' '
-       rm .git/config &&
+       rm -f .git/config &&
        git config quote.leading " test" &&
        git config quote.ending "test " &&
        git config quote.semicolon "test;test" &&