diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-03-23 00:00:22 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-23 00:00:22 +0300 |
commit | 2435feaa207eb3256dda978654b2a4308cdbd446 (patch) | |
tree | 136a6179216f388ce66a9c85145c620a6bda0231 /t | |
parent | 204333b015a663a339c855c72b86034203b66a6a (diff) | |
parent | 6fab35f748651c408cf300d871d24c920108d94f (diff) |
Merge branch 'mt/cleanly-die-upon-missing-required-filter'
We had a code to diagnose and die cleanly when a required
clean/smudge filter is missing, but an assert before that
unnecessarily fired, hiding the end-user facing die() message.
* mt/cleanly-die-upon-missing-required-filter:
convert: fail gracefully upon missing clean cmd on required filter
Diffstat (limited to 't')
-rwxr-xr-x | t/t0021-conversion.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index a9e10a0c21..b5749f327d 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -257,6 +257,30 @@ test_expect_success 'required filter clean failure' ' test_must_fail git add test.fc ' +test_expect_success 'required filter with absent clean field' ' + test_config filter.absentclean.smudge cat && + test_config filter.absentclean.required true && + + echo "*.ac filter=absentclean" >.gitattributes && + + echo test >test.ac && + test_must_fail git add test.ac 2>stderr && + test_i18ngrep "fatal: test.ac: clean filter .absentclean. failed" stderr +' + +test_expect_success 'required filter with absent smudge field' ' + test_config filter.absentsmudge.clean cat && + test_config filter.absentsmudge.required true && + + echo "*.as filter=absentsmudge" >.gitattributes && + + echo test >test.as && + git add test.as && + rm -f test.as && + test_must_fail git checkout -- test.as 2>stderr && + test_i18ngrep "fatal: test.as: smudge filter absentsmudge failed" stderr +' + test_expect_success 'filtering large input to small output should use little memory' ' test_config filter.devnull.clean "cat >/dev/null" && test_config filter.devnull.required true && |