From: Karthik Nayak Date: Tue, 10 Nov 2026 11:49:52 GMT Subject: [PATCH 07/20] t9300: make the series P tests self-contained Message-ID: <20261110-kn-fast-import-tests-1-v1-7-dbd9ee502aae@gmail.com> In-Reply-To: <20261110-kn-fast-import-tests-1-v1-0-dbd9ee502aae@gmail.com> Similar to the previous commits, modify the tests in 'series P' to make them independent of state from previous tests. Move the setup to a 'setup_gitlinks_repo()' function, so each test can invoke it. The 'fail on inline gitlink' and 'fail on blob mark in gitlink' tests create their commit on top of 'subuse2', which is only written by the 'verbatim SHA gitlinks' test. Use 'subuse1' from the setup instead, as these tests only check that the invalid gitlink is rejected. Signed-off-by: Karthik Nayak --- t/t9300-fast-import.sh | 290 +++++++++++++++++++++++++++---------------------- 1 file changed, 161 insertions(+), 129 deletions(-) diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 9b1827bae2..480ae2c47f 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -1866,157 +1866,189 @@ test_expect_success 'O: progress outputs as requested by input' ' ### series P (gitlinks) ### -test_expect_success 'P: superproject & submodule mix' ' - cat >input <<-INPUT_END && - blob - mark :1 - data 10 - test file - - reset refs/heads/sub - commit refs/heads/sub - mark :2 - committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE - data 12 - sub_initial - M 100644 :1 file - - blob - mark :3 - data < $GIT_COMMITTER_DATE - data 8 - initial - from refs/heads/main - M 100644 :3 .gitmodules - M 160000 :2 sub - - blob - mark :5 - data 20 - test file - more data - - commit refs/heads/sub - mark :6 - committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE - data 11 - sub_second - from :2 - M 100644 :5 file - - commit refs/heads/subuse1 - mark :7 - committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE - data 7 - second - from :4 - M 160000 :6 sub - - INPUT_END - - git fast-import input <<-INPUT_END && + blob + mark :1 + data 10 + test file + + reset refs/heads/sub + commit refs/heads/sub + mark :2 + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data 12 + sub_initial + M 100644 :1 file + + blob + mark :3 + data < $GIT_COMMITTER_DATE + data 8 + initial + from refs/heads/main + M 100644 :3 .gitmodules + M 160000 :2 sub + + blob + mark :5 + data 20 + test file + more data + + commit refs/heads/sub + mark :6 + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data 11 + sub_second + from :2 + M 100644 :5 file + + commit refs/heads/subuse1 + mark :7 + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data 7 + second + from :4 + M 160000 :6 sub + + INPUT_END + + git fast-import input <<-INPUT_END && - blob - mark :1 - data < $GIT_COMMITTER_DATE - data 8 - initial - from refs/heads/main - M 100644 :1 .gitmodules - M 160000 $SUBPREV sub + cat >input <<-INPUT_END && + blob + mark :1 + data < $GIT_COMMITTER_DATE - data 7 - second - from :2 - M 160000 $SUBLAST sub + commit refs/heads/subuse2 + mark :2 + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data 8 + initial + from refs/heads/main + M 100644 :1 .gitmodules + M 160000 $SUBPREV sub - INPUT_END + commit refs/heads/subuse2 + mark :3 + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data 7 + second + from :2 + M 160000 $SUBLAST sub - git branch -D sub && - git gc --prune=now && - git fast-import input <<-INPUT_END && - commit refs/heads/subuse3 - mark :1 - committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE - data <input <<-INPUT_END && + commit refs/heads/subuse3 + mark :1 + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data <input <<-INPUT_END && - blob - mark :1 - data < $GIT_COMMITTER_DATE - data <input <<-INPUT_END && + blob + mark :1 + data < $GIT_COMMITTER_DATE + data <