From: Karthik Nayak Date: Thu, 12 Nov 2026 17:34:11 GMT Subject: [PATCH v2 11/20] t9300: make the date format tests self-contained Message-ID: <20261112-kn-fast-import-tests-1-v2-11-b8c3a0ab27e8@gmail.com> In-Reply-To: <20261112-kn-fast-import-tests-1-v2-0-b8c3a0ab27e8@gmail.com> 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 --- 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 <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 <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 <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 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