Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t1310-config-default.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t1310-config-default.sh` 36 lines ยท 1055 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='Test git config in different settings (with --default)' 4 5 . ./test-lib.sh 6 7 test_expect_success 'uses --default when entry missing' ' 8 echo quux >expect && 9 git config -f config --default=quux core.foo >actual && 10 test_cmp expect actual 11 ' 12 13 test_expect_success 'does not use --default when entry present' ' 14 echo bar >expect && 15 git -c core.foo=bar config --default=baz core.foo >actual && 16 test_cmp expect actual 17 ' 18 19 test_expect_success 'canonicalizes --default with appropriate type' ' 20 echo true >expect && 21 git config -f config --default=yes --bool core.foo >actual && 22 test_cmp expect actual 23 ' 24 25 test_expect_success 'dies when --default cannot be parsed' ' 26 test_must_fail git config -f config --type=expiry-date --default=x --get \ 27 not.a.section 2>error && 28 test_grep "failed to format default config value" error 29 ' 30 31 test_expect_success 'does not allow --default without --get' ' 32 test_must_fail git config --default=quux --unset a.section >output 2>&1 && 33 test_grep "\-\-default is only applicable to" output 34 ' 35 36 test_done