{"thread":{"id":"12473","subject":"[PATCH 3/3] Add git-describe test for \"verify annotated tag names on output\"","startedAt":"2008-03-04T01:09:38Z","lastAt":"2008-03-04T01:09:38Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"70865","messageId":"20080304010938.GC15791@spearce.org","threadId":"12473","inReplyTo":null,"subject":"[PATCH 3/3] Add git-describe test for \"verify annotated tag names on output\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-03-04T01:09:38Z","receivedAt":"2008-03-04T01:09:38Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Back in 212945d4 (\"Teach git-describe to verify annotated tag names\nbefore output\") I taught git-describe to output the name shown in the\n\"tag\" header of an annotated tag, rather than the name it is actually\nstored under in this repository's ref namespace.\n\nThis test case verifies this is working correctly by renaming the ref\nfor an annotated tag to a different name that what is recorded in the\ntag body, and verifying that tag is returned.  We also verify there is\na message shown on stderr to inform the user that the tag is possibly\nstored under the wrong name locally.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n t/t6120-describe.sh |   17 ++++++++++++++++-\n 1 files changed, 16 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex cc24477..22425d5 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -15,8 +15,9 @@ test_description='test describe\n check_describe () {\n \texpect=\"$1\"\n \tshift\n-\tR=$(git describe \"$@\")\n+\tR=$(git describe \"$@\" 2>err.actual)\n \tS=$?\n+\tcat err.actual >&3\n \ttest_expect_success \"describe $*\" '\n \ttest $S = 0 &&\n \tcase \"$R\" in\n@@ -98,6 +99,20 @@ check_describe B --tags HEAD^^2^\n \n check_describe B-0-* --long HEAD^^2^\n \n+test_expect_success 'rename tag A to Q locally' '\n+\tmv .git/refs/tags/A .git/refs/tags/Q\n+'\n+cat - >err.expect <<EOF\n+warning: tag 'A' is really 'Q' here\n+EOF\n+check_describe A-* HEAD\n+test_expect_success 'warning was displayed for Q' '\n+\tgit diff err.expect err.actual\n+'\n+test_expect_success 'rename tag Q back to A' '\n+\tmv .git/refs/tags/Q .git/refs/tags/A\n+'\n+\n test_expect_success 'pack tag refs' 'git pack-refs'\n check_describe A-* HEAD\n \n-- \n1.5.4.3.529.gb25fb\n"}]}