diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-12-13 21:15:22 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-13 21:15:22 +0900 |
commit | 3748b5b7f5648b007dc3743e918ce5eaf44ee6fc (patch) | |
tree | 59400d19784a6872e57a8210f9629d90fbd6c9b0 /t/t1450-fsck.sh | |
parent | be85cfc4dbef9ffa177770f8607fd4a85445565e (diff) | |
parent | 7fe9bf55b84d2610a7ac09893b25ef188f145a21 (diff) | |
download | git-3748b5b7f5648b007dc3743e918ce5eaf44ee6fc.tar.gz |
Merge branch 'maint-2.33' into maint-2.34
Diffstat (limited to 't/t1450-fsck.sh')
-rwxr-xr-x | t/t1450-fsck.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 6337236fd8..36858878a0 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -928,4 +928,28 @@ test_expect_success 'fsck error and recovery on invalid object type' ' ) ' +test_expect_success 'fsck error on gitattributes with excessive line lengths' ' + blob=$(printf "pattern %02048d" 1 | git hash-object -w --stdin) && + test_when_finished "remove_object $blob" && + tree=$(printf "100644 blob %s\t%s\n" $blob .gitattributes | git mktree) && + test_when_finished "remove_object $tree" && + cat >expected <<-EOF && + error in blob $blob: gitattributesLineLength: .gitattributes has too long lines to parse + EOF + test_must_fail git fsck --no-dangling >actual 2>&1 && + test_cmp expected actual +' + +test_expect_success 'fsck error on gitattributes with excessive size' ' + blob=$(test-tool genzeros $((100 * 1024 * 1024 + 1)) | git hash-object -w --stdin) && + test_when_finished "remove_object $blob" && + tree=$(printf "100644 blob %s\t%s\n" $blob .gitattributes | git mktree) && + test_when_finished "remove_object $tree" && + cat >expected <<-EOF && + error in blob $blob: gitattributesLarge: .gitattributes too large to parse + EOF + test_must_fail git fsck --no-dangling >actual 2>&1 && + test_cmp expected actual +' + test_done |