diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-12-13 15:17:10 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-13 15:17:10 +0300 |
commit | fbabbc30e7bf3dee054ac74105d765fb0ec61893 (patch) | |
tree | 5aa6b5504bf788dd755e5f6b55805cc68ed1d6b2 /t/t1450-fsck.sh | |
parent | 868154bb1c08a547afaf74ed8bafdf9bf55d1fd5 (diff) | |
parent | 6c9466944c90c236217ec6f9ce5ed6b0e73903f9 (diff) |
Merge branch 'maint-2.34' into maint-2.35
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 de50c0ea01..6582a76521 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 |