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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Feb 3, 2025 at 07:29 UTC
b1be3953e5ff5c85853e184d16cb213e8f9c4623
1 file changed
+16
-19
t/t5504-fetch-receive-strict.sh
+16
-19
@@ -64,12 +64,6 @@ test_expect_success 'fetch with transfer.fsckobjects' '
64
)
65
'
66
67
-cat >exp <<EOF
68
-To dst
69
-! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects)
70
-Done
71
-EOF
72
-
67
test_expect_success 'push without strict' '
68
rm -rf dst &&
69
git init dst &&
@@ -78,6 +72,11 @@ test_expect_success 'push without strict' '
72
git config fetch.fsckobjects false &&
73
git config transfer.fsckobjects false
74
) &&
75
+ cat >exp <<-\EOF &&
76
+ To dst
77
+ ! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects)
78
+ Done
79
+ EOF
80
test_must_fail git push --porcelain dst main:refs/heads/test >act &&
81
test_cmp exp act
82
'
@@ -94,11 +93,6 @@ test_expect_success 'push with !receive.fsckobjects' '
93
test_cmp exp act
94
'
95
97
-cat >exp <<EOF
98
-To dst
99
-! refs/heads/main:refs/heads/test [remote rejected] (unpacker error)
100
-EOF
101
-
96
test_expect_success 'push with receive.fsckobjects' '
97
rm -rf dst &&
98
git init dst &&
@@ -107,6 +101,10 @@ test_expect_success 'push with receive.fsckobjects' '
101
git config receive.fsckobjects true &&
102
git config transfer.fsckobjects false
103
) &&
104
+ cat >exp <<-\EOF &&
105
+ To dst
106
+ ! refs/heads/main:refs/heads/test [remote rejected] (unpacker error)
107
+ EOF
108
test_must_fail git push --porcelain dst main:refs/heads/test >act &&
109
test_cmp exp act
110
'
@@ -129,15 +127,14 @@ test_expect_success 'repair the "corrupt or missing" object' '
127
git fsck
128
'
129
132
-cat >bogus-commit <<EOF
133
-tree $EMPTY_TREE
134
-author Bugs Bunny 1234567890 +0000
135
-committer Bugs Bunny <bugs@bun.ni> 1234567890 +0000
136
-
137
-This commit object intentionally broken
138
-EOF
139
-
130
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 <bugs@bun.ni> 1234567890 +0000
135
+
136
+ This commit object intentionally broken
137
+ EOF
138
commit="$(git hash-object --literally -t commit -w --stdin <bogus-commit)"
139
'
140