From: Karthik Nayak Date: Tue, 10 Nov 2026 11:50:01 GMT Subject: [PATCH 16/20] t9300: make the feature and option tests self-contained Message-ID: <20261110-kn-fast-import-tests-1-v1-16-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 R' which check the 'feature' command and the command line options to make them independent of state from previous tests. Signed-off-by: Karthik Nayak --- t/t9300-fast-import.sh | 188 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 136 insertions(+), 52 deletions(-) diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 3f0e7b8b1f..cf00e4faf9 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -2607,54 +2607,90 @@ test_expect_success 'Q: deny note on empty branch' ' ### test_expect_success 'R: abort on unsupported feature' ' - cat >input <<-EOF && - feature no-such-feature-exists - EOF + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && - test_must_fail git fast-import input <<-EOF && + feature no-such-feature-exists + EOF + + test_must_fail git fast-import input <<-EOF && - feature date-format=now - EOF + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && - git fast-import input <<-EOF && + feature date-format=now + EOF + + git fast-import input <<-EOF && - blob - data 3 - hi - feature date-format=now - EOF + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && - test_must_fail git fast-import input <<-EOF && + blob + data 3 + hi + feature date-format=now + EOF + + test_must_fail git fast-import git.marks && - echo "feature import-marks=git.marks" >input && - test_must_fail git fast-import input && - test_must_fail git fast-import git.marks && + echo "feature import-marks=git.marks" >input && + test_must_fail git fast-import input && + test_must_fail git fast-import git.marks && - >git2.marks && - cat >input <<-EOF && - feature import-marks=git.marks - feature import-marks=git2.marks - EOF + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && - test_must_fail git fast-import --allow-unsafe-features git.marks && + >git2.marks && + cat >input <<-EOF && + feature import-marks=git.marks + feature import-marks=git2.marks + EOF + + test_must_fail git fast-import --allow-unsafe-features input && - test_must_fail git fast-import input && + test_must_fail git fast-import input <<-EOF && - option git non-existing-option - EOF + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && - test_must_fail git fast-import input <<-EOF && + option git non-existing-option + EOF + + test_must_fail git fast-import input <<-EOF && - option non-existing-vcs non-existing-option - EOF + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && - git fast-import input <<-EOF && + option non-existing-vcs non-existing-option + EOF + + git fast-import