Skip to content

Commit b1be395

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 3b0d05c commit b1be395

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
@@ -64,12 +64,6 @@ test_expect_success 'fetch with transfer.fsckobjects' '
6464
)
6565
'
6666

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

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

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

0 commit comments

Comments
 (0)