{"thread":{"id":"52261","subject":"[PATCH] t7004: check existence of correct tag","startedAt":"2019-11-13T19:39:22Z","lastAt":"2019-11-14T06:35:13Z","messageCount":2,"participants":["Martin Ågren","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"386139","messageId":"20191113193902.29263-1-martin.agren@gmail.com","threadId":"52261","inReplyTo":null,"subject":"[PATCH] t7004: check existence of correct tag","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2019-11-13T19:39:02Z","receivedAt":"2019-11-13T19:39:22Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"We try to delete the non-existing tag \"anothertag\", but for the\nverifications, we check that the tag \"myhead\" doesn't exist. \"myhead\"\nisn't used in this test except for this checking. Comparing to the test\ntwo tests earlier, it looks like a copy-paste mistake.\n\nPerhaps it's overkill to check that `git tag -d` didn't decide to\n*create* a tag. But since we're trying to be this careful, let's\nactually check the correct tag. While we're doing this, let's use a more\ndescriptive tag name instead -- \"nonexistingtag\" should be obvious.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\n This is a resend of\n https://public-inbox.org/git/20190808125330.3104954-1-martin.agren@gmail.com/\n\n t/t7004-tag.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 80eb13d94e..e4cf605907 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -227,10 +227,10 @@ test_expect_success \\\n test_expect_success \\\n \t'trying to delete two tags, existing and not, should fail in the 2nd' '\n \ttag_exists mytag &&\n-\t! tag_exists myhead &&\n-\ttest_must_fail git tag -d mytag anothertag &&\n+\t! tag_exists nonexistingtag &&\n+\ttest_must_fail git tag -d mytag nonexistingtag &&\n \t! tag_exists mytag &&\n-\t! tag_exists myhead\n+\t! tag_exists nonexistingtag\n '\n \n test_expect_success 'trying to delete an already deleted tag should fail' \\\n-- \n2.24.0\n\n"},{"id":"386167","messageId":"20191114063511.GE10643@sigill.intra.peff.net","threadId":"52261","inReplyTo":"20191113193902.29263-1-martin.agren@gmail.com","subject":"Re: [PATCH] t7004: check existence of correct tag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-11-14T06:35:11Z","receivedAt":"2019-11-14T06:35:13Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Nov 13, 2019 at 08:39:02PM +0100, Martin Ågren wrote:\n\n> We try to delete the non-existing tag \"anothertag\", but for the\n> verifications, we check that the tag \"myhead\" doesn't exist. \"myhead\"\n> isn't used in this test except for this checking. Comparing to the test\n> two tests earlier, it looks like a copy-paste mistake.\n\nThanks, the description and patch look good to me.\n\n> Perhaps it's overkill to check that `git tag -d` didn't decide to\n> *create* a tag. But since we're trying to be this careful, let's\n> actually check the correct tag. While we're doing this, let's use a more\n> descriptive tag name instead -- \"nonexistingtag\" should be obvious.\n\nYes, that would be a spectacular bug indeed. :)\n\nI think it's fine to keep it in, though, as it communicates the\nexpectations pretty clearly.\n\n-Peff\n"}]}