🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
1 messages
1 total messages Started by Karthik Nayak Thu, 12 Nov 2026 17:34
[PATCH v2 11/20] t9300: make the date format tests self-contained
#2999
Author: Karthik Nayak
Date: Thu, 12 Nov 2026 17:34
108 lines
14844 bytes
Similar to the previous commits, modify the date format tests to
make them independent of state from previous tests.

Fold the 'E: verify pack' and 'E: verify commit' tests into the test
performing the import. As 'fastimport.unpackLimit' is no longer set by
an earlier test, set it for the import so that a pack is written, and
verify the pack with an inline loop in place of 'verify_packs()'.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 t/t9300-fast-import.sh | 72 ++++++++++++++++++++++++++++++++++----------------
 1 file changed, 49 insertions(+), 23 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 446cf0c51a..54394c892b 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -828,37 +828,63 @@ test_expect_success 'D: verify file6' '
 ###
 
 test_expect_success 'E: rfc2822 date, --date-format=raw' '
-	cat >input <<-INPUT_END &&
-	commit refs/heads/branch
-	author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> Tue Feb 6 11:22:18 2007 -0500
-	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> Tue Feb 6 12:35:02 2007 -0500
-	data <<COMMIT
-	RFC 2822 type date
-	COMMIT
+	test_when_finished "rm -rf repo" &&
+	git init repo &&
+	(
+		cd repo &&
+		test_commit one &&
 
-	from refs/heads/branch^0
+		cat >input <<-INPUT_END &&
+		commit refs/heads/main
+		author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> Tue Feb 6 11:22:18 2007 -0500
+		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> Tue Feb 6 12:35:02 2007 -0500
+		data <<COMMIT
+		RFC 2822 type date
+		COMMIT
 
-	INPUT_END
+		from refs/heads/main^0
 
-	test_must_fail git fast-import --date-format=raw <input
+		INPUT_END
+
+		test_must_fail git fast-import --date-format=raw <input
+	)
 '
+
 test_expect_success 'E: rfc2822 date, --date-format=rfc2822' '
-	git fast-import --date-format=rfc2822 <input
-'
+	test_when_finished "rm -rf repo" &&
+	git init repo &&
+	(
+		cd repo &&
+		test_commit one &&
 
-test_expect_success 'E: verify pack' '
-	verify_packs
-'
+		cat >input <<-INPUT_END &&
+		commit refs/heads/main
+		author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> Tue Feb 6 11:22:18 2007 -0500
+		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> Tue Feb 6 12:35:02 2007 -0500
+		data <<COMMIT
+		RFC 2822 type date
+		COMMIT
 
-test_expect_success 'E: verify commit' '
-	cat >expect <<-EOF &&
-	author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 1170778938 -0500
-	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1170783302 -0500
+		from refs/heads/main^0
 
-	RFC 2822 type date
-	EOF
-	git cat-file commit branch | sed 1,2d >actual &&
-	test_cmp expect actual
+		INPUT_END
+
+		git -c fastimport.unpackLimit=0 fast-import --date-format=rfc2822 <input &&
+
+		cat >expect <<-EOF &&
+		author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 1170778938 -0500
+		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1170783302 -0500
+
+		RFC 2822 type date
+		EOF
+		git cat-file commit main | sed 1,2d >actual &&
+		test_cmp expect actual &&
+
+		for p in .git/objects/pack/*.pack
+		do
+			git verify-pack "$p" || return 1
+		done
+	)
 '
 
 ###

-- 
2.56.GIT
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads