t1300: small style fixups

We have a couple of small style violations in t1300:

  - An empty newline at the start of the test body.

  - The test command is sometimes on the same line as the test name.

  - The closing single-quote is sometimes on the same line as the last
    command of the test.

Fix these.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-09-22 15:06:19 +02:00
committed by Junio C Hamano
parent f1371a3c95
commit 7f89ad8c8c

View File

@@ -213,7 +213,9 @@ test_expect_success 'Prohibited LF in comment' '
test_must_fail git config ${mode_set} --comment="a${LF}b" section.k v test_must_fail git config ${mode_set} --comment="a${LF}b" section.k v
' '
test_expect_success 'non-match result' 'test_cmp expect .git/config' test_expect_success 'non-match result' '
test_cmp expect .git/config
'
test_expect_success 'find mixed-case key by canonical name' ' test_expect_success 'find mixed-case key by canonical name' '
test_cmp_config Second sections.whatever test_cmp_config Second sections.whatever
@@ -455,9 +457,13 @@ EOF
test_cmp expect .git/config test_cmp expect .git/config
' '
test_expect_success 'invalid key' 'test_must_fail git config inval.2key blabla' test_expect_success 'invalid key' '
test_must_fail git config inval.2key blabla
'
test_expect_success 'correct key' 'git config 123456.a123 987' test_expect_success 'correct key' '
git config 123456.a123 987
'
test_expect_success 'hierarchical section' ' test_expect_success 'hierarchical section' '
git config Version.1.2.3eX.Alpha beta git config Version.1.2.3eX.Alpha beta
@@ -490,6 +496,7 @@ test_expect_success 'working --list' '
git config ${mode_prefix}list > output && git config ${mode_prefix}list > output &&
test_cmp expect output test_cmp expect output
' '
test_expect_success '--list without repo produces empty output' ' test_expect_success '--list without repo produces empty output' '
git --git-dir=nonexistent config ${mode_prefix}list >output && git --git-dir=nonexistent config ${mode_prefix}list >output &&
test_must_be_empty output test_must_be_empty output
@@ -887,16 +894,17 @@ test_expect_success bool '
git config --bool --get bool.true$i >>result && git config --bool --get bool.true$i >>result &&
git config --bool --get bool.false$i >>result || return 1 git config --bool --get bool.false$i >>result || return 1
done && done &&
test_cmp expect result' test_cmp expect result
'
test_expect_success 'invalid bool (--get)' ' test_expect_success 'invalid bool (--get)' '
git config ${mode_set} bool.nobool foobar && git config ${mode_set} bool.nobool foobar &&
test_must_fail git config --bool --get bool.nobool' test_must_fail git config --bool --get bool.nobool
'
test_expect_success 'invalid bool (set)' ' test_expect_success 'invalid bool (set)' '
test_must_fail git config --bool bool.nobool foobar
test_must_fail git config --bool bool.nobool foobar' '
test_expect_success 'set --bool' ' test_expect_success 'set --bool' '
cat >expect <<\EOF && cat >expect <<\EOF &&
@@ -999,7 +1007,8 @@ EOF
git config --path path.home "~/" && git config --path path.home "~/" &&
git config --path path.normal "/dev/null" && git config --path path.normal "/dev/null" &&
git config --path path.trailingtilde "foo~" && git config --path path.trailingtilde "foo~" &&
test_cmp expect .git/config' test_cmp expect .git/config
'
if test_have_prereq !MINGW && test "${HOME+set}" if test_have_prereq !MINGW && test "${HOME+set}"
then then
@@ -1117,10 +1126,13 @@ EOF
test_expect_success 'key with newline' ' test_expect_success 'key with newline' '
test_must_fail git config ${mode_get} "key.with test_must_fail git config ${mode_get} "key.with
newline" 123' newline" 123
'
test_expect_success 'value with newline' 'git config ${mode_set} key.sub value.with\\\ test_expect_success 'value with newline' '
newline' git config ${mode_set} key.sub value.with\\\
newline
'
cat > .git/config <<\EOF cat > .git/config <<\EOF
[section] [section]
@@ -1330,7 +1342,6 @@ test_expect_success 'multiple git -c appends config' '
' '
test_expect_success 'last one wins: two level vars' ' test_expect_success 'last one wins: two level vars' '
# sec.var and sec.VAR are the same variable, as the first # sec.var and sec.VAR are the same variable, as the first
# and the last level of a configuration variable name is # and the last level of a configuration variable name is
# case insensitive. # case insensitive.
@@ -1349,7 +1360,6 @@ test_expect_success 'last one wins: two level vars' '
' '
test_expect_success 'last one wins: three level vars' ' test_expect_success 'last one wins: three level vars' '
# v.a.r and v.A.r are not the same variable, as the middle # v.a.r and v.A.r are not the same variable, as the middle
# level of a three-level configuration variable name is # level of a three-level configuration variable name is
# case sensitive. # case sensitive.