Skip to content

Commit abd2a39

Browse files
pks-tgitster
authored andcommitted
t5504: modernize test by moving heredocs into test bodies
We have several heredocs in t5504 located outside of any particular test bodies. Move these into the test bodies to match our modern coding style. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 777489f commit abd2a39

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

t/t5504-fetch-receive-strict.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ test_expect_success 'fetch with transfer.fsckobjects' '
6565
)
6666
'
6767

68-
cat >exp <<EOF
69-
To dst
70-
! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects)
71-
Done
72-
EOF
73-
7468
test_expect_success 'push without strict' '
7569
rm -rf dst &&
7670
git init dst &&
@@ -79,6 +73,11 @@ test_expect_success 'push without strict' '
7973
git config fetch.fsckobjects false &&
8074
git config transfer.fsckobjects false
8175
) &&
76+
cat >exp <<-EOF &&
77+
To dst
78+
! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects)
79+
Done
80+
EOF
8281
test_must_fail git push --porcelain dst main:refs/heads/test >act &&
8382
test_cmp exp act
8483
'
@@ -95,11 +94,6 @@ test_expect_success 'push with !receive.fsckobjects' '
9594
test_cmp exp act
9695
'
9796

98-
cat >exp <<EOF
99-
To dst
100-
! refs/heads/main:refs/heads/test [remote rejected] (unpacker error)
101-
EOF
102-
10397
test_expect_success 'push with receive.fsckobjects' '
10498
rm -rf dst &&
10599
git init dst &&
@@ -108,6 +102,10 @@ test_expect_success 'push with receive.fsckobjects' '
108102
git config receive.fsckobjects true &&
109103
git config transfer.fsckobjects false
110104
) &&
105+
cat >exp <<-EOF &&
106+
To dst
107+
! refs/heads/main:refs/heads/test [remote rejected] (unpacker error)
108+
EOF
111109
test_must_fail git push --porcelain dst main:refs/heads/test >act &&
112110
test_cmp exp act
113111
'
@@ -130,15 +128,14 @@ test_expect_success 'repair the "corrupt or missing" object' '
130128
git fsck
131129
'
132130

133-
cat >bogus-commit <<EOF
134-
tree $EMPTY_TREE
135-
author Bugs Bunny 1234567890 +0000
136-
committer Bugs Bunny <[email protected]> 1234567890 +0000
137-
138-
This commit object intentionally broken
139-
EOF
140-
141131
test_expect_success 'setup bogus commit' '
132+
cat >bogus-commit <<-EOF &&
133+
tree $EMPTY_TREE
134+
author Bugs Bunny 1234567890 +0000
135+
committer Bugs Bunny <[email protected]> 1234567890 +0000
136+
137+
This commit object intentionally broken
138+
EOF
142139
commit="$(git hash-object --literally -t commit -w --stdin <bogus-commit)"
143140
'
144141

0 commit comments

Comments
 (0)