diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh index bc3f69b4b1..a5822e41af 100755 --- a/t/t2016-checkout-patch.sh +++ b/t/t2016-checkout-patch.sh @@ -4,7 +4,7 @@ test_description='git checkout --patch' . ./lib-patch-mode.sh -if ! test_bool_env GIT_TEST_ADD_I_USE_BUILTIN true && ! test_have_prereq PERL +if ! test_have_prereq ADD_I_USE_BUILTIN && ! test_have_prereq PERL then skip_all='skipping interactive add tests, PERL not set' test_done diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 94537a6b40..fc26cb8bae 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -538,7 +538,15 @@ test_expect_success 'split hunk "add -p (edit)"' ' ! grep "^+15" actual ' -test_expect_failure 'split hunk "add -p (no, yes, edit)"' ' +test_expect_success 'setup ADD_I_USE_BUILTIN check' ' + result=success && + if ! test_have_prereq ADD_I_USE_BUILTIN + then + result=failure + fi +' + +test_expect_$result 'split hunk "add -p (no, yes, edit)"' ' test_write_lines 5 10 20 21 30 31 40 50 60 >test && git reset && # test sequence is s(plit), n(o), y(es), e(dit) @@ -562,7 +570,7 @@ test_expect_success 'split hunk with incomplete line at end' ' test_must_fail git grep --cached before ' -test_expect_failure 'edit, adding lines to the first hunk' ' +test_expect_$result 'edit, adding lines to the first hunk' ' test_write_lines 10 11 20 30 40 50 51 60 >test && git reset && tr _ " " >patch <<-EOF && diff --git a/t/test-lib.sh b/t/test-lib.sh index 736c6447ec..f5291ef56e 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1759,6 +1759,10 @@ test_lazy_prereq SHA1 ' esac ' +test_lazy_prereq ADD_I_USE_BUILTIN ' + test_bool_env GIT_TEST_ADD_I_USE_BUILTIN true +' + # Ensure that no test accidentally triggers a Git command # that runs the actual maintenance scheduler, affecting a user's # system permanently.