aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-06-28 15:53:10 -0700
committerJunio C Hamano <gitster@pobox.com>2024-06-28 15:53:10 -0700
commit6840423c6fa27085aad8b091fc73ea1d9bcdadd6 (patch)
treef18f336383fa618ae4154011b84a5ba0ffcb92f3 /t
parenta5adab9b16efbcc82f9168f3c3ae18a74a567bf3 (diff)
parentc793f9cb0853b7b173228efa53b32c60e3818598 (diff)
downloadgit-6840423c6fa27085aad8b091fc73ea1d9bcdadd6.tar.gz
Merge branch 'tb/attr-limits' into maint-2.45
The maximum size of attribute files is enforced more consistently. * tb/attr-limits: attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()
Diffstat (limited to 't')
-rwxr-xr-xt/t0003-attributes.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index d755cc3c29..71f082836a 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -578,6 +578,16 @@ test_expect_success EXPENSIVE 'large attributes file ignored in index' '
test_cmp expect err
'
+test_expect_success EXPENSIVE 'large attributes blob ignored' '
+ test_when_finished "git update-index --remove .gitattributes" &&
+ blob=$(dd if=/dev/zero bs=1048576 count=101 2>/dev/null | git hash-object -w --stdin) &&
+ git update-index --add --cacheinfo 100644,$blob,.gitattributes &&
+ tree="$(git write-tree)" &&
+ git check-attr --cached --all --source="$tree" path >/dev/null 2>err &&
+ echo "warning: ignoring overly large gitattributes blob ${SQ}.gitattributes${SQ}" >expect &&
+ test_cmp expect err
+'
+
test_expect_success 'builtin object mode attributes work (dir and regular paths)' '
>normal &&
attr_check_object_mode normal 100644 &&