git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Karthik Nayak <karthik.188@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 3/7] t1400: exercise reflog with gaps with reftable backend
Date: Thu, 15 Feb 2024 09:25:38 +0100	[thread overview]
Message-ID: <ed57913eb95e4031ef3319b37aa0972c8c1ee89a.1707985173.git.ps@pks.im> (raw)
In-Reply-To: <cover.1707985173.git.ps@pks.im>

[-- Attachment #1: Type: text/plain, Size: 1808 bytes --]

In t1400, we have a test that exercises whether we print a warning
message as expected when the reflog contains entries which have a gap
between the old entry's new object ID and the new entry's old object ID.
While the logic should apply to all ref backends, the test setup writes
into `.git/logs` directly and is thus "files"-backend specific.

Refactor the test to instead use `git reflog delete` to create the gap
and drop the REFFILES prerequisite.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/t1400-update-ref.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index bf37763bd6..6ebc3ef945 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -426,15 +426,15 @@ test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
 rm -f expect
 git update-ref -d $m
 
-test_expect_success REFFILES 'query reflog with gap' '
+test_expect_success 'query reflog with gap' '
 	test_when_finished "git update-ref -d $m" &&
 
-	git update-ref $m $F &&
-	cat >.git/logs/$m <<-EOF &&
-	$Z $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150320 -0500
-	$A $B $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150380 -0500
-	$D $F $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150680 -0500
-	EOF
+	GIT_COMMITTER_DATE="1117150320 -0500" git update-ref $m $A &&
+	GIT_COMMITTER_DATE="1117150380 -0500" git update-ref $m $B &&
+	GIT_COMMITTER_DATE="1117150480 -0500" git update-ref $m $C &&
+	GIT_COMMITTER_DATE="1117150580 -0500" git update-ref $m $D &&
+	GIT_COMMITTER_DATE="1117150680 -0500" git update-ref $m $F &&
+	git reflog delete $m@{2} &&
 
 	git rev-parse --verify "main@{2005-05-26 23:33:01}" >actual 2>stderr &&
 	echo "$B" >expect &&
-- 
2.44.0-rc0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-02-15  8:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09  7:23 [PATCH 0/7] t: drop more REFFILES prereqs Patrick Steinhardt
2024-02-09  7:23 ` [PATCH 1/7] t: move tests exercising the "files" backend Patrick Steinhardt
2024-02-14 22:45   ` Junio C Hamano
2024-02-09  7:23 ` [PATCH 2/7] t0410: enable tests with extensions with non-default repo format Patrick Steinhardt
2024-02-14 22:57   ` Junio C Hamano
2024-02-15  7:59     ` Patrick Steinhardt
2024-02-15 17:18       ` Junio C Hamano
2024-02-09  7:23 ` [PATCH 3/7] t1400: exercise reflog with gaps with reftable backend Patrick Steinhardt
2024-02-14 22:59   ` Junio C Hamano
2024-02-09  7:23 ` [PATCH 4/7] t1404: make D/F conflict tests compatible " Patrick Steinhardt
2024-02-14 23:11   ` Junio C Hamano
2024-02-09  7:23 ` [PATCH 5/7] t1405: remove unneeded cleanup step Patrick Steinhardt
2024-02-14 23:17   ` Junio C Hamano
2024-02-15  7:59     ` Patrick Steinhardt
2024-02-09  7:23 ` [PATCH 6/7] t2011: exercise D/F conflicts with HEAD with the reftable backend Patrick Steinhardt
2024-02-09  7:23 ` [PATCH 7/7] t7003: ensure filter-branch prunes reflogs " Patrick Steinhardt
2024-02-11 14:00 ` [PATCH 0/7] t: drop more REFFILES prereqs Karthik Nayak
2024-02-14 23:20 ` Junio C Hamano
2024-02-15  8:14   ` Patrick Steinhardt
2024-02-15  8:25 ` [PATCH v2 " Patrick Steinhardt
2024-02-15  8:25   ` [PATCH v2 1/7] t: move tests exercising the "files" backend Patrick Steinhardt
2024-02-15  8:25   ` [PATCH v2 2/7] t0410: convert tests to use DEFAULT_REPO_FORMAT prereq Patrick Steinhardt
2024-02-15 18:19     ` Junio C Hamano
2024-02-15  8:25   ` Patrick Steinhardt [this message]
2024-02-15  8:25   ` [PATCH v2 4/7] t1404: make D/F conflict tests compatible with reftable backend Patrick Steinhardt
2024-02-15  8:25   ` [PATCH v2 5/7] t1405: remove unneeded cleanup step Patrick Steinhardt
2024-02-15  8:25   ` [PATCH v2 6/7] t2011: exercise D/F conflicts with HEAD with the reftable backend Patrick Steinhardt
2024-02-15  8:25   ` [PATCH v2 7/7] t7003: ensure filter-branch prunes reflogs " Patrick Steinhardt

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=ed57913eb95e4031ef3319b37aa0972c8c1ee89a.1707985173.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    /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).