diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-12-13 21:20:35 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-13 21:20:35 +0900 |
commit | 431f6e67e620f1b4f9acfddd356b56a3fd5c5e79 (patch) | |
tree | a8b7ed273a64477bb7e605acf611edfb866860f0 /t/t1450-fsck.sh | |
parent | 83d5e3341b69b3116675f13d2fab208a12c79e27 (diff) | |
parent | ad949b24f8d6ee4767c07794a2f01ada91b46b74 (diff) | |
download | git-431f6e67e620f1b4f9acfddd356b56a3fd5c5e79.tar.gz |
Merge branch 'maint-2.36' into maint-2.37
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 53c2aa10b7..922984b903 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -951,4 +951,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 |