Browse Source

Merge branch 'ar/test-cleanup-unused-file-creation-part2'

Test cleanup.

* ar/test-cleanup-unused-file-creation-part2:
  t2019: don't create unused files
  t1502: don't create unused files
  t1450: don't create unused files
  t1300: don't create unused files
  t1300: fix config file syntax error descriptions
  t0300: don't create unused file
main
Junio C Hamano 2 years ago
parent
commit
7f3cc51b28
  1. 2
      t/t0300-credentials.sh
  2. 10
      t/t1300-config.sh
  3. 5
      t/t1450-fsck.sh
  4. 6
      t/t1502-rev-parse-parseopt.sh
  5. 4
      t/t2019-checkout-ambiguous-ref.sh

2
t/t0300-credentials.sh

@ -808,7 +808,7 @@ test_expect_success 'credential config with partial URLs' ' @@ -808,7 +808,7 @@ test_expect_success 'credential config with partial URLs' '

git -c credential.$partial.helper=yep \
-c credential.with%0anewline.username=uh-oh \
credential fill <stdin >stdout 2>stderr &&
credential fill <stdin 2>stderr &&
test_i18ngrep "skipping credential lookup for key" stderr
'


10
t/t1300-config.sh

@ -1601,11 +1601,11 @@ test_expect_success 'git config --edit respects core.editor' ' @@ -1601,11 +1601,11 @@ test_expect_success 'git config --edit respects core.editor' '
# malformed configuration files
test_expect_success 'barf on syntax error' '
cat >.git/config <<-\EOF &&
# broken section line
# broken key=value
[section]
key garbage
EOF
test_must_fail git config --get section.key >actual 2>error &&
test_must_fail git config --get section.key 2>error &&
test_i18ngrep " line 3 " error
'

@ -1615,17 +1615,17 @@ test_expect_success 'barf on incomplete section header' ' @@ -1615,17 +1615,17 @@ test_expect_success 'barf on incomplete section header' '
[section
key = value
EOF
test_must_fail git config --get section.key >actual 2>error &&
test_must_fail git config --get section.key 2>error &&
test_i18ngrep " line 2 " error
'

test_expect_success 'barf on incomplete string' '
cat >.git/config <<-\EOF &&
# broken section line
# broken value string
[section]
key = "value string
EOF
test_must_fail git config --get section.key >actual 2>error &&
test_must_fail git config --get section.key 2>error &&
test_i18ngrep " line 3 " error
'


5
t/t1450-fsck.sh

@ -989,10 +989,7 @@ test_expect_success 'fsck error and recovery on invalid object type' ' @@ -989,10 +989,7 @@ test_expect_success 'fsck error and recovery on invalid object type' '

garbage_blob=$(git hash-object --stdin -w -t garbage --literally </dev/null) &&

cat >err.expect <<-\EOF &&
fatal: invalid object type
EOF
test_must_fail git fsck >out 2>err &&
test_must_fail git fsck 2>err &&
grep -e "^error" -e "^fatal" err >errors &&
test_line_count = 1 errors &&
grep "$garbage_blob: object is of unknown type '"'"'garbage'"'"':" err

6
t/t1502-rev-parse-parseopt.sh

@ -302,14 +302,14 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:" @@ -302,14 +302,14 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
|EOF
END_EXPECT

test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
test_cmp expect actual
'

test_expect_success 'test --parseopt invalid opt-spec' '
test_write_lines x -- "=, x" >spec &&
echo "fatal: missing opt-spec before option flags" >expect &&
test_must_fail git rev-parse --parseopt -- >out <spec 2>err &&
test_must_fail git rev-parse --parseopt -- <spec 2>err &&
test_cmp expect err
'

@ -339,7 +339,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l @@ -339,7 +339,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
|EOF
END_EXPECT

test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
test_cmp expect actual
'


4
t/t2019-checkout-ambiguous-ref.sh

@ -16,7 +16,7 @@ test_expect_success 'setup ambiguous refs' ' @@ -16,7 +16,7 @@ test_expect_success 'setup ambiguous refs' '
'

test_expect_success 'checkout ambiguous ref succeeds' '
git checkout ambiguity >stdout 2>stderr
git checkout ambiguity 2>stderr
'

test_expect_success 'checkout produces ambiguity warning' '
@ -37,7 +37,7 @@ test_expect_success 'checkout reports switch to branch' ' @@ -37,7 +37,7 @@ test_expect_success 'checkout reports switch to branch' '
'

test_expect_success 'checkout vague ref succeeds' '
git checkout vagueness >stdout 2>stderr &&
git checkout vagueness 2>stderr &&
test_set_prereq VAGUENESS_SUCCESS
'


Loading…
Cancel
Save