{"thread":{"id":"61123","subject":"[PATCH] t5300: fix test_with_bad_commit()","startedAt":"2024-03-15T04:57:30Z","lastAt":"2024-03-15T17:07:44Z","messageCount":2,"participants":["John Cai via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"490661","messageId":"pull.1688.git.git.1710478646776.gitgitgadget@gmail.com","threadId":"61123","inReplyTo":null,"subject":"[PATCH] t5300: fix test_with_bad_commit()","fromName":"John Cai via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-03-15T04:57:26Z","receivedAt":"2024-03-15T04:57:30Z","isPatch":true,"sender":{"key":"johncai86@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2354211?v=4"},"body":"From: John Cai <johncai86@gmail.com>\n\n0f8edf7317 (index-pack: --fsck-objects to take an optional argument for\nfsck msgs, 2024-02-01) added a test function test_with_bad_commit() that\ncontained two bugs. test_expect_fail was used instead of test_must_fail,\nand a && was not included at the end of the line.\n\nFix these two issues in the test.\n\nSigned-off-by: John Cai <johncai86@gmail.com>\n---\n    t5300: fix test_with_bad_commit()\n    \n    0f8edf7317 (index-pack: --fsck-objects to take an optional argument for\n    fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that\n    contained two bugs. test_expect_fail was used instead of test_must_fail,\n    and a && was not included at the end of the line.\n    \n    Fix these two issues in the test.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1688%2Fjohn-cai%2Fjc%2Ffix-t5300-tests-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1688/john-cai/jc/fix-t5300-tests-v1\nPull-Request: https://github.com/git/git/pull/1688\n\n t/t5300-pack-object.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex a58f91035d1..61e2be2903d 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -465,7 +465,7 @@ test_with_bad_commit () {\n \tmust_pass_arg=\"$2\" &&\n \t(\n \t\tcd strict &&\n-\t\ttest_expect_fail git index-pack \"$must_fail_arg\" \"test-$(cat pack-name).pack\"\n+\t\ttest_must_fail git index-pack \"$must_fail_arg\" \"test-$(cat pack-name).pack\" &&\n \t\tgit index-pack \"$must_pass_arg\" \"test-$(cat pack-name).pack\"\n \t)\n }\n\nbase-commit: e09f1254c54329773904fe25d7c545a1fb4fa920\n-- \ngitgitgadget\n"},{"id":"490699","messageId":"xmqqttl7qv8q.fsf@gitster.g","threadId":"61123","inReplyTo":"pull.1688.git.git.1710478646776.gitgitgadget@gmail.com","subject":"Re: [PATCH] t5300: fix test_with_bad_commit()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-15T17:07:33Z","receivedAt":"2024-03-15T17:07:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"John Cai via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: John Cai <johncai86@gmail.com>\n>\n> 0f8edf7317 (index-pack: --fsck-objects to take an optional argument for\n> fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that\n> contained two bugs. test_expect_fail was used instead of test_must_fail,\n> and a && was not included at the end of the line.\n>\n> Fix these two issues in the test.\n\nWow.  This is an embarrassing one.  Thanks for a fix.\n\n> Signed-off-by: John Cai <johncai86@gmail.com>\n> ---\n>     t5300: fix test_with_bad_commit()\n>     \n>     0f8edf7317 (index-pack: --fsck-objects to take an optional argument for\n>     fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that\n>     contained two bugs. test_expect_fail was used instead of test_must_fail,\n>     and a && was not included at the end of the line.\n>     \n>     Fix these two issues in the test.\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1688%2Fjohn-cai%2Fjc%2Ffix-t5300-tests-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1688/john-cai/jc/fix-t5300-tests-v1\n> Pull-Request: https://github.com/git/git/pull/1688\n>\n>  t/t5300-pack-object.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\n> index a58f91035d1..61e2be2903d 100755\n> --- a/t/t5300-pack-object.sh\n> +++ b/t/t5300-pack-object.sh\n> @@ -465,7 +465,7 @@ test_with_bad_commit () {\n>  \tmust_pass_arg=\"$2\" &&\n>  \t(\n>  \t\tcd strict &&\n> -\t\ttest_expect_fail git index-pack \"$must_fail_arg\" \"test-$(cat pack-name).pack\"\n> +\t\ttest_must_fail git index-pack \"$must_fail_arg\" \"test-$(cat pack-name).pack\" &&\n>  \t\tgit index-pack \"$must_pass_arg\" \"test-$(cat pack-name).pack\"\n>  \t)\n>  }\n>\n> base-commit: e09f1254c54329773904fe25d7c545a1fb4fa920\n"}]}