From: Patrick Steinhardt Date: Mon, 3 Feb 2025 06:29:31 +0000 (+0100) Subject: t5504: modernize test by moving heredocs into test bodies X-Git-Tag: v2.49.0-rc0~23^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1be3953e5ff5c85853e184d16cb213e8f9c4623;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index e273ab29c7..58074506c5 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -64,12 +64,6 @@ test_expect_success 'fetch with transfer.fsckobjects' ' ) ' -cat >exp <exp <<-\EOF && + To dst + ! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects) + Done + EOF test_must_fail git push --porcelain dst main:refs/heads/test >act && test_cmp exp act ' @@ -94,11 +93,6 @@ test_expect_success 'push with !receive.fsckobjects' ' test_cmp exp act ' -cat >exp <exp <<-\EOF && + To dst + ! refs/heads/main:refs/heads/test [remote rejected] (unpacker error) + EOF test_must_fail git push --porcelain dst main:refs/heads/test >act && test_cmp exp act ' @@ -129,15 +127,14 @@ test_expect_success 'repair the "corrupt or missing" object' ' git fsck ' -cat >bogus-commit < 1234567890 +0000 - -This commit object intentionally broken -EOF - test_expect_success 'setup bogus commit' ' + cat >bogus-commit <<-EOF && + tree $EMPTY_TREE + author Bugs Bunny 1234567890 +0000 + committer Bugs Bunny 1234567890 +0000 + + This commit object intentionally broken + EOF commit="$(git hash-object --literally -t commit -w --stdin