git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: orgads@gmail.com
To: git@vger.kernel.org
Cc: Orgad Shaneh <orgads@gmail.com>
Subject: [PATCH] add a test for "describe --contains" with mixed tags
Date: Tue, 24 Oct 2017 20:02:42 +0300	[thread overview]
Message-ID: <20171024170242.31894-1-orgads@gmail.com> (raw)

From: Orgad Shaneh <orgads@gmail.com>

If a repository has early lightweight tags and annotated tags later,
running git describe --contains for an early commit used the annotated
tag for reference, instead of the lightweight tag which was closer.

This has been fixed in ef1e74065c19cc427c4a1b322154fd55d7a3588b,
and regression was tweaked in 5554451de61cb90e530f30b96e62d455e1eff6a1.

Add a test for that to avoid further regressions.

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 t/t6120-describe.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 1c0e8659d..08427f4b5 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -340,4 +340,20 @@ test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
 	test_cmp expect actual
 '
 
+test_expect_success 'describe --contains for light before annotated' '
+	test_tick &&
+	git commit --allow-empty -m First &&
+	test_tick &&
+	git commit --allow-empty -m Second &&
+	test_tick &&
+	git commit --allow-empty -m Third &&
+	test_tick &&
+	git tag light-before-annotated HEAD^ &&
+	test_tick &&
+	git tag -a -m annotated annotated-after-light
+
+'
+
+check_describe light-before-annotated~1 --contains light-before-annotated~1
+
 test_done
-- 
2.15.0.rc2


             reply	other threads:[~2017-10-24 17:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 17:02 orgads [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-19 19:55 [PATCH] add a test for "describe --contains" with mixed tags orgads

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171024170242.31894-1-orgads@gmail.com \
    --to=orgads@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).