git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/7] t1400: exercise reflog with gaps with reftable backend

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 15, 2024, 08:25 UTC
Message-ID
<ed57913eb95e4031ef3319b37aa0972c8c1ee89a.1707985173.git.ps@pks.im>
In-Reply-To
<cover.1707985173.git.ps@pks.im>

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
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 24 of 28 in “t: drop more REFFILES prereqs”
  1. 0/7 t: drop more REFFILES prereqsPatrick Steinhardt, Feb 9, 2024
  2. 1/7 t: move tests exercising the "files" backendPatrick Steinhardt, Feb 9, 2024
  3. Junio C HamanoFeb 14, 2024
  4. 2/7 t0410: enable tests with extensions with non-default repo formatPatrick Steinhardt, Feb 9, 2024
  5. Junio C HamanoFeb 14, 2024
  6. Patrick SteinhardtFeb 15, 2024
  7. Junio C HamanoFeb 15, 2024
  8. 3/7 t1400: exercise reflog with gaps with reftable backendPatrick Steinhardt, Feb 9, 2024
  9. Junio C HamanoFeb 14, 2024
  10. 4/7 t1404: make D/F conflict tests compatible with reftable backendPatrick Steinhardt, Feb 9, 2024
  11. Junio C HamanoFeb 14, 2024
  12. 5/7 t1405: remove unneeded cleanup stepPatrick Steinhardt, Feb 9, 2024
  13. Junio C HamanoFeb 14, 2024
  14. Patrick SteinhardtFeb 15, 2024
  15. 6/7 t2011: exercise D/F conflicts with HEAD with the reftable backendPatrick Steinhardt, Feb 9, 2024
  16. 7/7 t7003: ensure filter-branch prunes reflogs with the reftable backendPatrick Steinhardt, Feb 9, 2024
  17. Karthik NayakFeb 11, 2024
  18. Junio C HamanoFeb 14, 2024
  19. Patrick SteinhardtFeb 15, 2024
  20. 0/7 t: drop more REFFILES prereqsPatrick Steinhardt, Feb 15, 2024
  21. 1/7 t: move tests exercising the "files" backendPatrick Steinhardt, Feb 15, 2024
  22. 2/7 t0410: convert tests to use DEFAULT_REPO_FORMAT prereqPatrick Steinhardt, Feb 15, 2024
  23. Junio C HamanoFeb 15, 2024
  24. 3/7 t1400: exercise reflog with gaps with reftable backendPatrick Steinhardt, Feb 15, 2024
  25. 4/7 t1404: make D/F conflict tests compatible with reftable backendPatrick Steinhardt, Feb 15, 2024
  26. 5/7 t1405: remove unneeded cleanup stepPatrick Steinhardt, Feb 15, 2024
  27. 6/7 t2011: exercise D/F conflicts with HEAD with the reftable backendPatrick Steinhardt, Feb 15, 2024
  28. 7/7 t7003: ensure filter-branch prunes reflogs with the reftable backendPatrick Steinhardt, Feb 15, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.